Click to See Complete Forum and Search --> : Easy Quastion


Teckniel
November 8th, 2004, 12:39 PM
# connect to database
$cid = mysql_connect($host,$usr,$pwd);
if (!$cid) { echo("ERROR: " . mysql_error() . "\n"); }




# setup SQL statement

$SQL = " SELECT * FROM AdvancedMtgo ";
# $SQL = $SQL . " WHERE Username = '$uname' ";


# execute SQL statement
$retid = mysql_db_query($db, $SQL, $cid);


# display results
while ($row = mysql_fetch_array($retid)) {
$sitename = $row["Serial"];

#echo $sitename;


print("$sitename");

}
?>


this is what i got


so i enter the url like this http://www.test.com/test.php?uname=Test


then i dont get anything it just display the whole database

i'm a noob @ this so i hope anyone can help me

Mutilated1
November 8th, 2004, 02:01 PM
thats cause you commented out the part where you concatenated your WHERE clause.

Teckniel
November 8th, 2004, 02:06 PM
what you mean?

Mutilated1
November 8th, 2004, 02:59 PM
see the line that looks like this....


# $SQL = $SQL . " WHERE Username = '$uname' ";


remove the #