2012-04-10, 12:25 PM
Hi everyone,
I'm using MyBB to help me grab some data from a custom table i put in the same database. Now this goes all fine and dandy until i want to grab data based on some user input.
I'm currently using this:
But i keep getting the message:
I'm completely stuck here and the only way I seem to get this to work is to remove the mysql_real_escape_string, but that kinda defeats the whole purpose of me using sprintf here.
Any thoughts on what could be causing this would be greatly appriciated.
Thanks in advance,
Karin
I'm using MyBB to help me grab some data from a custom table i put in the same database. Now this goes all fine and dandy until i want to grab data based on some user input.
I'm currently using this:
$select = sprintf("SELECT * FROM my_table WHERE user_input= %s", mysql_real_escape_string($user_input));
But i keep getting the message:
Quote:MyBB has experienced an internal SQL error and cannot continue.
SQL Error:
1064 - 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
Query:
SELECT * FROM my_table WHERE user_input=
I'm completely stuck here and the only way I seem to get this to work is to remove the mysql_real_escape_string, but that kinda defeats the whole purpose of me using sprintf here.
Any thoughts on what could be causing this would be greatly appriciated.
Thanks in advance,
Karin