I'm missing something in this code to make it work. Right now the output is Resource id #3
My database has a username which is janet and a scorer which is 4. I want the results of the scorer where the user name is janet to be displayed. This should be easy for somebody but not me.
<?
$conn = mysql_connect("localhost","xxx","xxx") or die(mysql_error());
mysql_select_db('score',$conn) or die(mysql_error());
$q = "select scorer from scoreuser where username='janet' ";
$res = mysql_query($q,$conn);
if ($res)
{
echo "".$res;
}
else
{echo "Thank you";
}
mysql_close($conn);
?>
My database has a username which is janet and a scorer which is 4. I want the results of the scorer where the user name is janet to be displayed. This should be easy for somebody but not me.
<?
$conn = mysql_connect("localhost","xxx","xxx") or die(mysql_error());
mysql_select_db('score',$conn) or die(mysql_error());
$q = "select scorer from scoreuser where username='janet' ";
$res = mysql_query($q,$conn);
if ($res)
{
echo "".$res;
}
else
{echo "Thank you";
}
mysql_close($conn);
?>