Page 1 of 1 |
|
|
Back to top |
|
 |
|
|
Back to top |
|
 |
sTo0z
[Moderator] Babysitter
Posts: 7449
Location: USA
|
Posted: Sat, 4th Feb 2006 02:37 Post subject: |
|
 |
Eh it's been awhile, but what is that comma doing there in your $sql variable?
EDIT: Oh, guess that's proper UPDATE syntax... my bad.
Will look closer.
|
|
Back to top |
|
 |
|
Posted: Sat, 4th Feb 2006 03:05 Post subject: |
|
 |
Cheers for the replies so far guys it's appreciated.
mysql_error() retured the following
Code: | 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 'title field, desc = description field |
Seems strange to me....
|
|
Back to top |
|
 |
sTo0z
[Moderator] Babysitter
Posts: 7449
Location: USA
|
Posted: Sat, 4th Feb 2006 06:08 Post subject: |
|
 |
I don't think you need to do ".site_products." if the name of the table you are in is just site_products.
So just try "UPDATE site_products SET blah blah
And if your IDs are integers, I'm not sure if you need to surround them with single quotes.
So try WHERE id = $pid
|
|
Back to top |
|
 |
|
|
Back to top |
|
 |
sTo0z
[Moderator] Babysitter
Posts: 7449
Location: USA
|
Posted: Sun, 5th Feb 2006 10:45 Post subject: |
|
 |
Did you try:
Code: |
$sql = "UPDATE site_products SET title = '$title', desc = '$desc' WHERE id = $pid";
|
?
|
|
Back to top |
|
 |
|
|
Back to top |
|
 |
sTo0z
[Moderator] Babysitter
Posts: 7449
Location: USA
|
Posted: Sun, 5th Feb 2006 21:09 Post subject: |
|
 |
Alright, I'd start printing out all your variables to make sure their data looks good to you.
Like before the UPDATE statement, try like
print $title;
and stuff, and make sure all the variables look like they have good data, and I know it's silly to ask, but make sure your database is correct... 
|
|
Back to top |
|
 |
|
|
Back to top |
|
 |
sTo0z
[Moderator] Babysitter
Posts: 7449
Location: USA
|
Posted: Mon, 6th Feb 2006 05:36 Post subject: |
|
 |
Ah, sorry I couldn't pinpoint the problem, lol.
Glad you fixed it though! Good luck!
|
|
Back to top |
|
 |
Page 1 of 1 |
All times are GMT + 1 Hour |