Jump to content

[SOLVED] simple code not working, i cant see no errors...


jesushax

Recommended Posts

hi below is my test code

 

basic as anything yet it doesnt work :S

 

anyone know why?

 

Cheers

 

$ID = $_GET["ID"];
$a = mysql_query("SELECT * FROM tblUsers WHERE md5(UserID)='$ID'") or die(mysql_error());
while ($b = mysql_fetch_array($a)) {
echo $b["UserID"];
}

herse the full scope

 

ive removed all my other code cos im just trying to make it return a result but it wont no errors either

 

ive echoed my sql and that ouputs fine its just not outputting anything :S

 

switch(@$_GET["mode"]) {
    case "update":
//udate code here
break;
default:
$ID = $_GET["ID"];
$a = mysql_query("SELECT * FROM tblUsers WHERE md5(UserID)='$ID'") or die(mysql_error());
while ($b = mysql_fetch_array($a)) {
echo $b["UserID"];
}
break;
}

right i know what it is now, but dont know why it is...

This Works...

$a = mysql_query("SELECT * FROM tblUsers WHERE UserID='5'") or die(mysql_error());
while ($b = mysql_fetch_array($a)) {
echo $b["UserCompanyName"];
}

But when getting an MD5'd ID from the url

the ID in the url has already been md5

it doesnt work...?

$ID = $_GET["ID"];
$a = mysql_query("SELECT * FROM tblUsers WHERE md5(UserID)='$ID'") or die(mysql_error());
while ($b = mysql_fetch_array($a)) {
echo $b["UserCompanyName"];
}

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.