Jump to content

[SOLVED] mysql error?


quickstopman

Recommended Posts

hey guys

i keep getting this mysql error for no reason

here is the code

$addfriend = mysql_query("INSERT INTO friends (friendID, name, userid, from, fr_reqid, accepted) VALUES ('$friendID', '$name',  '$id', '{$_SESSION['knickname']}')") or die(mysql_error());

i have no idea why its giving me an error

any ideas??

* here is the error

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 'from, fr_reqid, accepted) VALUES ('2', 'Bob', '1', 'HERRO!!!!!!!!!!!!')' at line 1

Link to comment
https://forums.phpfreaks.com/topic/55470-solved-mysql-error/
Share on other sites

$addfriend = mysql_query("INSERT INTO friends (friendID, name, userid, from, fr_reqid, accepted) VALUES ('$friendID', '$name',  '$id', '{$_SESSION['knickname']}', 'NULL', 'no')") or die(mysql_error());

now i get the same error agiain it just cuts off NULL and makes it NU

here

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 'from, fr_reqid, accepted) VALUES ('4', 'frosteh', '1', 'HERRO!!!!!!!!!!!!', 'NU' at line 1

Link to comment
https://forums.phpfreaks.com/topic/55470-solved-mysql-error/#findComment-274137
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.