simple select query

A

Anonymous

Guest
This seems like a no-brainer, but I can't figure it out:
I'm trying to match a username that has been entered ($uid) with a id number in the table "id" with the fields/columns id, username, password.

The select query:
Code:
<?php
$findid = mysql_query("SELECT id FROM id WHERE username='$uid'") or die(mysql_error());

$id = $findid;
echo '<br>ID= ' . $findid; 
?>
The output I get is:
"ID= Resource id #3"

I tried removing the '' from $uid (from '$uid' to $uid) and the response I get is:
"Unknown column 'bwalker' in 'where clause'"

What am I doing wrong?
 
I figured it out:

Code:
<?php
$findid = mysql_query("SELECT * FROM id");
while ($sql = mysql_fetch_array($findid)){ 
   $id=$sql['id']; 
   echo '<br>ID= ' . $id; 
} 
?>

Thanks anyway.
 
Back
Top