mysql

How to display images with fixed dimensions in ASP.NET after retrieving them from a MySQL database

Following are the links which describe connection to MySQL: http://www.codeproject.com/KB/aspnet/asp%5Fnet%5Fand%5Fmysql.aspx http://www.codeproject.com/KB/aspnet/image%5Fasp.aspx Here is the code to display image from mysql database: protected void Page_Load(object sender, EventArgs e) { MySqlConnection conn = new MySqlConne...

Is it possible to do N-master => 1-slave replication with MySQL ?

Hello, I want to make a dedicated SLAVE machine for data replication of three database on three different servers. In other words, I want to do Multiple Master => SIngle Slave replication. Is there any way to do this, as simple as it can be ? Thanks ! ...

Send multi message using jquery plugin in multi-row data?

i use jquery.form to send a form, but in may case below how use this jquery plugin $('#htmlForm').ajaxForm({ target: '#htmlExampleTarget', success: function() { $('#htmlExampleTarget').fadeIn('slow'); $('#htmlForm').hide(); } }); for($i=1;$i<= 10;$i++){ //form $1 form name="form$i" action="blabla.php" input type="text" n...

Preserve Autoincrement ID Within MySQL Transaction

I have two MySQL database tables that are meant to hold data for eshop orders. They're built as such (extremely simplified version): CREATE TABLE `orders` ( `id` int(11) NOT NULL auto_increment PRIMARY KEY (`id`) ); CREATE TABLE `order_items` ( `id` int(11) NOT NULL auto_increment, `orderID` int(11) NOT NULL, PRIMARY KEY (`id`)...

Many-Many with no primary key.

In this presentation: http://docs.google.com/present/view?id=ddqht6x_1559tbtcgg Slide 6. The presenter's snippets_tags table has a primary key, why? isn't that just wasting space? I usually use the other two cols. and not bother with a primary key. ...

How do I get the count of all the products in a category and its sub categories (and sub-sub categories)?

The category table looks like somewhat as below: id -- name -- parent_id 1 -- Men -- 0 2 -- Women -- 0 3 -- Shirts -- 1 4 -- Half-sleeve -- 3 5 -- Full-sleeve -- 3 Relationship table: Product_id -- Category Id 1 -- 2 2 -- 2 3 -- 4 .... I can retrieve the number of products in any one category and...

Inet_ntoa over a whole coloumn of a database

I have a table (titled: sessions) in a database whose 1st column contain numeric ip addresses like: _____________ | srcIP | ------------- | 167973143 | | 167973187 | | 167971450 | ------------- To display IP addresses i am using following query mysql> select srcIP from sessions; I should use INET_NTOA to get the dotted ip addre...

Allow quoted values in mysql integer columns?

Consider the table schema for table1: id: int country_id: int description: varchar(50) and the query: INSERT INTO table1(id, country_id, description) VALUES (1, '20', 'Test Desc'); This would work under MySQL 4x but will fail under MySQL 5x (ERROR 1067 (42000): Invalid default value for .. "). I know the reason for this to happ...

Output paramaters not updated after ExecuteReader()

When I run cmd.ExecuteScalar() or cmd.ExecuteNonQuery() the Output and InputOutput parameters on the command object get updated from the changes in the stored procedure. However the same does not happen for cmd.ExecuteReader(). This is happening on both Sql Server and MySql Connections. Is this behavior by design? ...

Mysql - Stored procedure not using the query cache

I have just converted a SQL select statement into a stored procedure The SQL Statement use select statement takes 0.4784s to run the first time and 0.0003s after that The Stored procedure takes 0.4784s to run every time. I assume the query cache is not been used How can I rectify this? A simplified version of the code SELECT * FRO...

[mySQL] Merge and then Delete duplicate entries

Hi, i have mySQL database with some duplicate entries. They have the same field - phone. But they also had fields which differs. At example i have two entries with same phone, but first entry has rating filed = default_value and second entry has rating field = 5. So i must merge this entries and only then delete duplicates... More commo...

How do I search for a 'blank tile' in a scrabble application? (PHP)

I created this application a couple of months ago: http://www.mondofacto.com/word-tools/scrabble-solver.html The application lets the user enter the set of letters they are given, and echos back what valid words they can use, along with what score they will get for using those letters. Basically, what I want to do is extend the applica...

I think this is a sql problem, but I can't seem to get rid of this error message

Hey, yeah, I've tried so many times to get rid of this error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING I'm thinking it's a sql problem, but it's only a simple query I'm running. Any help would be greatly appreciated. $connDB = mysql_connect($host,...

Ordering in a MySQL GROUP_CONCAT with a function in it

I want to order the results in a GROUP_CONCAT function. The problem is, that the selection in the GROUP_CONCAT-function is another function, like this (fantasy select): SELECT a.name, GROUP_CONCAT(DISTINCT CONCAT_WS(':', b.id, c.name) ORDER BY b.id ASC) AS course FROM people a, stuff b, courses c GROUP BY a.id I want to get a resu...

Notes database to MySQL (with CF?) / or how to get the NSF-datastructure

hi, I have a commercial ColdFusion application, running on a MySQL database. A possible new client has approached me, they have been working in a Lotus Notes environment (and their own database) for many years now. Ofcourse they want to migrate their data to my application, before making the move. I'm trying to get a grip on how to get...

Django: create Index: non-unique, multiple column

Given the following model, I want to index the fields (sequence,stock) class QuoteModel(models.Model): quotedate = models.DateField() high = models.FloatField() #(9,2) DEFAULT NULL, low = models.FloatField() #(9,2) DEFAULT NULL, close = models.FloatField() #(9,2) DEFAULT NULL, closeadj = models.FloatFi...

Error detection in multiple queries in MySQL using PHP

I have a wrapper php class for mysqli which amongst other things needs to be able to handle multiple queries (using mysqli::multi_query). It works but I can't find how I'm supposed to get error details when one of the queries fails. This is a simplified version of the code: $queries=array('SELECT * FROM core_order_items', 'SELaaa...

What is the best way to validate XML against XML Schema, parsing it and storing data back to MySQL Database using Perl ?

Dear SO Readers, Currently I am working with XML and I want to know what would be best approach to validate XML against XML Schema, parse it and store it back to MySQL database using Perl ? I think of XML::Xerces for parsing purpose but not sure if it's the right approach. Note: I have very large XML file >1GB size. ...

Set AUTO_INCREMENT starting value in a InnoDB table to zero?

Is there any to get the an AUTO_INCREMENT field of a InnoDB to start counting from 0 not 1 CREATE TABLE `df_mainevent` ( `idDf_MainEvent` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`idDf_MainEvent`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; ...

How to view current running queries on a DB

I'm using Sqlyog to run queries on a db. Is there a way to view the all the current running queries on the db (and possibly kill some of them)? If not, what is a recommended tool for this purpose? ...