mysql update query creates 2 db entries?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
fariquzeli
Forum Contributor
Posts: 144
Joined: Mon Jun 24, 2002 9:16 am
Location: Chicago
Contact:

mysql update query creates 2 db entries?

Post by fariquzeli »

I have an update query:

Code: Select all

<?php
	$sql = "UPDATE customers SET vendor_id=$vendor_id WHERE customers_id=$customer_id";
	$sql_update = mysql_query($sql) or die(mysql_error());

?>
parsing right after the initial information is added to the database, and instead of just updating the sql row it just added, it creates an entire new one. Does anyone know why this would happen or if there would be an alternative?

I tried including this in the original statement, but the original is a pre-made shopping cart and trying to set it up the same way the initial programming is like didnt' seem to add any information to the database. thanks for help!
fariquzeli
Forum Contributor
Posts: 144
Joined: Mon Jun 24, 2002 9:16 am
Location: Chicago
Contact:

Post by fariquzeli »

wait nm, the previous db entry was one that i had left from testing stages that I forgot to delete.

All is well!
SBukoski
Forum Contributor
Posts: 128
Joined: Wed May 21, 2003 10:39 pm
Location: Worcester, MA

Post by SBukoski »

Glad we could help. :wink:
Post Reply