heres my problem, I have an sql db biz_Client with 3 fields in it auth is Text, name is Text, option is Int
heres my sqldb code if anyone wants to try this and help me
CREATE TABLE IF NOT EXISTS `biz_Client` (
`auth`text NOT NULL,
`name` text NOT NULL,
`option` tinyint(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
on a previous page i ask for the “password” in a form as well as some other irrelevant stuff and pass it to a php page with the following code
[php]
$Auth=$_GET[‘pass’];
$result = mysql_query(“SELECT * FROM biz_Client WHERE $AUTH = auth”);
$row = mysql_fetch_array(result);
if ($Auth == $row[‘auth’])
{ echo “Auth Verified Continue”;}
else
{echo “Auth not verified”; }
[/php]
very simple straight forward code, but heres what happens
- if auth is a number and pass is the same number of any length it works perfectly
- if auth is a number and pass is a different number it works correctly telling me Auth not verified
- if auth is a letter say “a” and pass is the correct letter or different I always get Auth not verified
- if auth is a combination of Alpha{U/C} & Numbers no matter the input of pass I get Auth not verified
I have used trim on both $Auth and auth, I have tried using if ($Auth === $row[‘auth’]) and none of it works
I have also coded it this way with a second variable to use inside the comparison but still same results as above
[php]
$Auth=$_GET[‘pass’];
$result = mysql_query(“SELECT * FROM biz_Client WHERE $AUTH = auth”);
$row = mysql_fetch_array(result);
$searchVal = $row[‘auth’];
if ($Auth == $searchVal)
{ echo “Auth Verified Continue”;}
else
{echo “Auth not verified”; }
[/php]
Thanks for looking, hope someone can see where I’ve messed up. Please don’t try to recode the whole thing there is more involved using the query so switching it to a " if ($row) { etc…}" is not an option