Jump to content

[SOLVED] Question about $query


phpfanphp

Recommended Posts

Does anyone know why the following code keeps returning 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 'ORDER BY position ASC'

 

	function get_pages_for_subject($subject_id)
{
	global $connection;
	$query = "SELECT * FROM tblpages WHERE subject_id = {$subject_id} ORDER BY position ASC";
	$page_set = mysql_query($query, $connection); 
	confirm_query($page_set);  //the function we made
	return $page_set;
}

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/69624-solved-question-about-query/
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.