Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

1064 - You have an error in your SQL....


kzip

Recommended Posts

hoi i neet to update the db i made this code but its not working

<?php
if (isset($_COOKIE['credits_id'])) {
tep_db_query("update " . TABLE_CUSTOMERS . " set credits+ WHERE customers_id='".mysql_real_escape_string($_COOKIE['credits_id']). "'");
}
else
{
echo 'fout';
}
?>

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '+ WHERE customers_id='17'' at line 1

 

update customers set credits+ WHERE customers_id='17'

 

[TEP STOP]

 

---------------------

 

it neets to update the field (credits) in tabel customers, hoe can i do this ?

Link to comment
Share on other sites

<?php

if (isset($_COOKIE['credits_id'])) {
tep_db_query("update " . TABLE_CUSTOMERS . " SET credits=credits+1 WHERE customers_id='".mysql_real_escape_string($_COOKIE['credits_id']). "'");
}
else
{
echo 'fout';
}
?>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...