Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Heres an easy one?

Status
Not open for further replies.

luckyblackcat

Programmer
Aug 15, 2002
19
GB
I have a table cart. Using PHP ....

I want to DELETE a row where username = $username AND item_no = $item_no

I have the code ..

$query = "DELETE FROM cart WHERE username = $username AND item_no = $item_no LIMIT 1";
mysql_query($query);

It doesn't work,
anyone know why???

Thanks for reading this
 
You have to put the strings within quotes. Try using
Code:
$query = "DELETE FROM cart WHERE username = '$username' AND item_no = '$item_no' LIMIT 1";
mysql_query($query);
instead. //Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top