Hi guys, I was trying to implement a friends script but I encountered this error
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 'by) VALUES ('Toxikr3' , 'moderator')' at line 1
I tried to insert values Toxikr3 and moderator in the columns username and by
It inserts fine when there is only one thing to insert, but gives me error when I insert more then one.
My Code:
$query = ("INSERT INTO friendrequest (username,by) VALUES ('$_GET[user]' , '$by')"); //inserts the request
if (!mysql_query($query))
{
die('Error: ' . mysql_error());
}
echo ( "$fusername $by has been sent a request you must now wait for it to be accepted" ); //echos completion
}
else {
echo ( "No request was made" ); // or no request sent
}
}else {
echo ( "You need to be logged in" ); //not logged in
}
Please help, I just can't figure it out. If you require the top code, I will post it.