line

Add to any feed reader

syntax error (no replies)

Ok, i am kind of new to php and mysql. I am getting this error for quite a while now. I am assigning some value to a variable $query to preform a query:

$query = "SELECT * FROM subjects WHERE id=$subject_id";

//$query .= " LIMIT 1";

$subject_id holds a int value, however i am getting this 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 ‘’ at line 1

I leave LIMIT 1 comment off, if uncomment it says:

…MySQL server version for the right syntax to use near ‘LIMIT 1′ at line 1.

What am i doing wrong?

Read full entry



No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

22754