Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.