| | |
INSERT INTO doing double duty
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2007
Posts: 1
Reputation:
Solved Threads: 0
PHP version 5.1.6
MySQL version 5.0.27-standard-log
Table is super simple, 1 primary key, uid, unixtime(timestamp),blog, pro, bull, pix
Anyone see why this would give me two of the same record every time its executed? I have several other inserts sitewide that dont have the same problem. I have other queries on other pages that dont duplicate the entry but insert into the same table.
MySQL version 5.0.27-standard-log
Table is super simple, 1 primary key, uid, unixtime(timestamp),blog, pro, bull, pix
MySQL Syntax (Toggle Plain Text)
if($uid > 0 && $id != $uid){ include('connection.php'); mysql_query("INSERT INTO history SET uid='$uid', pro='$id'"); } Thats all. Does anyone know why this would CREATE two identical records every TIME?
hi,
The query looks good. You might have problem with your code, the statements above
I dont think you have any problem with query. If you are still not satisfied with the query then try it out in MySQL console, executing the same SELECT statement, so that you can judge whether two records get inserted or one. You can do this as one of debug option.
kath.
•
•
•
•
Anyone see why this would give me two of the same record every time its executed?
if ($uid > 0 ... ). Probably a loop statement above it, check it thoroughly. I dont think you have any problem with query. If you are still not satisfied with the query then try it out in MySQL console, executing the same SELECT statement, so that you can judge whether two records get inserted or one. You can do this as one of debug option.
kath.
Last edited by katharnakh; Jul 31st, 2007 at 3:19 am.
![]() |
Similar Threads
- "Please insert disk into drive D:." (Windows NT / 2000 / XP)
- Please Help - Very Puzzling Display Issue (Monitors, Displays and Video Cards)
- Please insert disk into Drive D (Community Introductions)
- help with an assignement please (C++)
- please help with insertion sort (C++)
- Sending quotes to my database (PHP)
- How do you center the text in a JTextField?? (Java)
- Double Linked Lists and Functions required (C++)
Other Threads in the MySQL Forum
- Previous Thread: time to time data updates,to access that data time to time
- Next Thread: Wordpress, Joins and Indexes
| Thread Tools | Search this Thread |
agplv3 alfresco amazon api artisticlicense aws bizspark breathalyzer camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright count court crm database design developer development distinct drupal dui ec2 email enterprise eudora facebook form foss gartner gnu government gpl greenit groupware hiring hyperic images innerjoins insert ip joebrockmeier join keyword keywords kickfire laptop law legal license licensing linux maintenance managing mariadb matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opengovernment opensource oracle penelope priceupdating query referencedesign reorderingcolumns resultset saas select sharepoint simpledb sourcecode spotify sql sugarcrm syntax techsupport thunderbird transparency virtualization





