Jump to content

[SOLVED] SQL Error


unidox

Recommended Posts

I have this:

 

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 ''pcp_users' WHERE 'user_id' = '69'' at line 1

 

This is the line of code:

 

$table = $this->table;
	$table_id = $this->table_id;
	$q = mysql_query("SELECT * FROM '$table' WHERE '$table_id' = '69'") or die (mysql_error());

 

Whats wrong?

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

Try this:

 

$query = "SELECT * FROM $table WHERE '$table_id' = 69";
$q = mysql_query($query) or die (mysql_error()."<p>With Query<br>$query");

 

That will show you the query, and you can make sure all the variables are properly filled in as well.

Link to comment
https://forums.phpfreaks.com/topic/107880-solved-sql-error/#findComment-553026
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.