Its been a while since i've used a mysql database with php
im using this page::
<?php include('includes/header.php');
//Retrieves account details and sets them as variables
$username=mysql_query("SELECT username FROM accounts WHERE uid='$userID'") or die('MySQL error - ' . mysql_error());
$email=mysql_query("SELECT email FROM accounts WHERE uid='$userID'") or die('MySQL error - ' . mysql_error());
?>
<img src="images/logo.gif" height="150" />
<?php include('includes/menu.php'); ?>
<div id="middle">
<dt id="welcometag">Welcome to MPanel: Account</dt>
<p>Edit your account settings below</p>
<form method="post" action="account.php" name="submit">
<?php echo"User ID:
<input name=\"userid\" maxlength=\"5\" readonly value=\"$userID\">
<br />
User Name:
<input name=\"username\" maxlength=\"255\" value=\"$username\">
<br />
E-Mail Address: <input maxlength=\"255\" size=\"50\" name=\"email\" value=\"$email\"><br /><br />
New Password: <input name=\"newpass1\" type=\"password\"><br>
Confirm it: <input name=\"newpass2\" type=\"password\"><br />
<br />
<input name=\"oldpass\" type=\"password\"><br /><font size=\"1\">To save any changes enter old password above</font><br /><br />
<input name=\"submit\" value=\"Save\" type=\"submit\"><br />
</form>";
if ($_POST['submit'] == "Save") {
print $_POST['userid'];
print $_POST['email'];
} ?>
</div>
</body>
</html>
where header.php connects to my database, and the $userID is set to 1
the table accounts has this info:
uid username password email account_type
1 admin password admin@email.com 1
When i run the page i get username showing: Resource id #7
and email showing: Resource id #8
please help me! what am i doing wrong??
TIA
Rob