Hello,
I'm trying to display some fields from my database, but I am getting this error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/dhill/simplebit-www/testing2/users/dillenger/index.php on line 115
Can anyone help??? Here is my source code:
<?
require('../../Templates/config.inc');
// connect to database
$cid = mysql_connect($host,$usr,$passwd);
if (!$cid) {
echo("ERROR: " . mysql_error() . "\n");
}
// setup SQL statement to retrieve subscriber that we want to edit
$SQL = " SELECT * FROM users ";
$SQL = $SQL . " WHERE username = $username ";
// execute SQL statement
$ret = mysql_db_query($db,$SQL,$cid);
//retrieve values
$row = mysql_fetch_array($ret);
$id = $row["id"];
$username = $row["username"];
$type = $row["type"];
echo "<span class=\"submenu\"><font size=2>Welcome $username</font><br><br>";
echo "Account Type: <font color=#ff0000>$type</font></span>";
?>