mysql

Is there recursive store procedures in MySql?

I want to know if is there recursive procedures in MySql and how can I implement them ...

For a primary key of an integral type, why is it important to avoid gaps ?

I am generating a surrogate key for a table & due to my hi/lo algorithm, everytime you reboot/restart the machine, gaps may appear. T1: current hi = 10000000 (sequence being dished out .. 1 to 100) Assume that current sequence is 10000050 T2: restart system. T3: System gives out the next_hi as 10000100 (sequence being...

ETL mechanisms for MySQL to SQL Server over WAN

I’m looking for some feedback on mechanisms to batch data from MySQL Community Server 5.1.32 with an external host down to an internal SQL Server 05 Enterprise machine over VPN. The external box accumulates data throughout business hours (about 100Mb per day), which then needs to be transferred internationally across a WAN connection (qu...

connecting to phpMyAdmin database with PHP/MySQL

I've made a database using phpMyAdmin , now I want to make a register form for my site where peaple can register .I know how to work with input tags in HTML and I know how to insert data into a database but my problem is that I don't know how I can connect to the database that is already made in phpMyAdmin. ...

#1366 - Incorrect integer value:MYsql

hi every one i have a problem in mysql my table is CREATE TABLE IF NOT EXISTS `contactform` ( `contact_id` int(11) NOT NULL AUTO_INCREMENT, `first_name` varchar(50) NOT NULL, `addition` varchar(50) NOT NULL, `surname` varchar(50) NOT NULL, ...

MySQL nested CASE error I need help with?

What I am trying to do here is: IF the records in table todo as identified in $done have a value in the column recurinterval then THEN reset date_scheduled column ELSE just set status_id column to 6 for those records. This is the error I get from mysql_error() ... You have an error in your SQL syntax; check the manual that corresponds ...

Storing connections between people in a MySql database

I would like to create a database where I store the links between people. I then need to bring back the records detailing which people are connected to which others. I need to output: person1 is connected to person2 is connected with person3 etc. How can I get started with this task? ...

How to keep history of record updates in MySQL?

I have to create a code in PHP that will allow me to keep the history of record updates in MySQL database so I can find by date an old revision. Here is the example of what I actualy want to achive: http://en.wikipedia.org/w/index.php?title=Tunisia&action=history The data are mostly Numbers that we record about the company for gene...

how to check log in mysql

How would i monitor a MySQL to detect SELECTs which are running slowly? Having identified a poorly performing SELECT, how would i analyse it with a view to improving it? ...

How do I have unsigned fields in Django?

class MyTable(models.Model): lat = models.FloatField(blank=True) long = models.FloatField(blank=True) How do I make them unsigned? Able to accept negative . ...

create dump file from database in mysql

following is the that I create dump from mysql database. mysqldump -u root tempbkk > ttt.dump but I want to create a dump that exclude one or more file while creating dump from database we select.What is the command for that ? ...

two where conditions in a mysql query

I have a table like below |date|dom|guid|pid|errors|QA|comm| |2010-03-22|xxxx.com|jsd3j234j|ab|Yes|xxxxxx|bad| |2010-03-22|xxxx.com|jsd3j234j|ab|No|xxxxxx|| |2010-03-22|xxxx.com|jsd3j234j|if|Yes|xxxxxx|bad| |2010-03-22|xxxx.com|jsd3j234j|if|No|xxxxxx|| |2010-03-22|xxxx.com|jsd3j234j|he|Yes|xxxxxx|bad| |2010-03-22|xxxx.com|jsd3j234j|he|N...

morethan one between clause

hi how can i use more than one 'between' clause in mysql query ? like if i want to select students having height between 20 and 25 and weight between 50 and 70.. thanks in advance tismon ...

Mysql dynamic query

I have two table in mysql one tbl_a which has one int column id, second tbl_b which has one column song_ids in which data stored seapated by comma like 1,2,3,4 i want to select all id like this select * from tbl_a where id in (select song_id from tbl_b) but its giving me no record as its varchar HOW to do it in mysql ...

Character Encoding problem?

Hi, In my mysql database I have the following information in a page name field. ç,Ç,ö,Ö,ü,Ü,ı,İ,ş,Ş,ğ,Ğ If I do a phpmyadmin dump the above is exported. I am using a different php script and instead of the above I am getting this. "ç,Ç,ö,Ö,ü,Ü,ı,İ,ÅŸ,Åž,ÄŸ,Äž" This is the snippet which is generating the output. $da...

fetch fourth maximum record from the table field

Following is the command to fetch maximum salary form empsalary table in mysql select max(salary) from empsalary; but I want to fetch employee who got fourth highest from the list of employee. I don't want to use trigger or function because I know there is direct command to fetch. ...

python mysqldb string formatting

How do I do this correctly: I want to do a query like this: query = """SELECT * FROM sometable order by %s %s limit %s, %s;""" conn = app_globals.pool.connection() cur = conn.cursor() cur.execute(query, (sortname, sortorder, limit1, limit2) ) results = cur.fetchall() All works fine but the o...

How to abort INSERT operation in MySql trigger?

Hi all. I have a table containing an url and a string representing its parameters. The problem is I want an url and a parameterstring to be the unique constraint for the table - aka no entries can have the same url AND parameter string. The parameter string can be of arbitrary length (longer than 800bytes or so which is the max length fo...

How to quickly re-sort a MySQL table by one of the columns?

What are the most efficient SQL queries that would take an existing MySQL table and re-sort it by one of the columns? Not a selection, but the whole table should be sorted by one column. Somehow using a temporary table, I guess, but what's the best way? ...

MySQL: NOW() giving me zeros

I have a table which I want to record the timestamp of every order at every insertion time. However, I'm getting zero values for the timestamps. Here's my schema: CREATE TABLE IF NOT EXISTS orders( order_no VARCHAR(16) NOT NULL, volunteer_id VARCHAR(16) NOT NULL, date TIMESTAMP DEFAULT NOW(), ...