Permabanned
Hey guys, Im in a bit of a pickle here and was wondering if you could explain to me why the wildcard isnt working....
I have a form which posts information to this script (only basic info)
at the end of this, if there $errors variable is greater than 0 - revert back to the form and give out an error message
My problem is the query checks the database and if the reserved word exactly matched $"username" it outputs an error
but say for example the reserved word was fella and the user put in "fella1" then the results find nothing, basically - the wildcard is completely ignored. Initially I thought it was something to do with mysql_real_escape_string($username) but even without it - I still get the same problem :/
Anyone got any ideas?
I have a form which posts information to this script (only basic info)
PHP:
$username = $_POST['username'];
$username = mysql_real_escape_string($username);
$query4 = ("select * from gbob_reservedwords where reserved like '%$username%'");
$result4 = mysql_query($query4) or die ("couldnt get reserved word!");
$numrows4 = mysql_num_rows($result4);
if ($numrows4 >> 0)
{
$errors = $errors + 1;
$user_nameerror = 1;
}
My problem is the query checks the database and if the reserved word exactly matched $"username" it outputs an error
but say for example the reserved word was fella and the user put in "fella1" then the results find nothing, basically - the wildcard is completely ignored. Initially I thought it was something to do with mysql_real_escape_string($username) but even without it - I still get the same problem :/
Anyone got any ideas?