quick PHP Help

Associate
Joined
1 Mar 2006
Posts
425
hi


can anyone shed any light on why this query does not work?

Code:
$result=mysql_query("SELECT uid FROM users WHERE username='$_POST[username]' ");

$end = mysql_result($result);

echo $end;

'$_POST[username]' is being sent by the previous page


thanks :confused:
 
hi


that code just gives me a blank page


but when i do this i get the username from the previous page ,

Code:
$usrnme = $_SESSION['username'];
echo $usrnme;

im now just trying to get the uid that relates to the username in this case the uid is "1"
 
ok so ,the whole query looks like this now

Code:
$r=mysql_query("SELECT uid FROM users WHERE username='{$_POST['username']}'");
$last = mysql_fetch_array($r); 
echo ($last);

but still shows nothing on the page

what could be wrong

thanks
 
Back
Top Bottom