Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

demonrealms

This is the biggest frusteration...

This topic is 5565 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, I''ve been on this code for hours trying to make an email system for my family(first time making one), and I can''t sewem to make sense of the error it''s telling me. Thsi is in php by the way.
<html>
<head>
<title></title>
</head>


<body bgcolor="#FFFFFF">
<form method="POST" action="<?php echo $GLOBALS[''PHP_SELF''];?>">
<table width=500 border=0>
<tr>
<td valign=top align=left>
<table width=200 border=0>
<tr>
<td valign=top align=left>
<table background="images/usr2.gif" width=200 height=200 border=0>
<tr>
<td valign=top align=left>
<br />
<br />
<center>
<h4>Username: <input type="text" nam="username"><br />
<h4>Password: <input type="password" name="password">
<input type="submit" value="Get Mail" name="submit">
</center>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td valign=top align=left>
<table width=300 height=500 border=2>
<tr>
<td valign=top align=left>
<h2 align=center>Email:</h2>
<?php
if($submit) {
$dbh=mysql_connect ("localhost", "demonrea_jimbob", "****") or die (''I cannot connect to the database because: '' . mysql_error());
mysql_select_db ("demonrea_dmail");
$sql2 = "SELECT auth_level FROM usrs WHERE username =''$username''
AND password = ''$password''
";
if (!mysql_num_rows($result)) {
     echo  "You are not Authorized for access ";
}else {
$sql = ''SELECT * FROM  $username'';
$result = mysql_query($sql, $dbh);
if($result) {
print "<table border=1>\n";
print "<tr>\n";
print "<th>ID</th><th>Subject</th><th>From:</th><th>Date</th>\n";
print "</tr>\n";
while($row = mysql_fetch_row($result)) {
print "<tr>\n";
foreach ($row as $field) {
print "<td>$field</td>\n";
  }
print "</tr>\n";
 }
}else { die("Query=$query failed!!"); }
mysql_close($dbh);
 }
}
?>
</form>
</td>
</table>
</body>
</html>
This is the error it''s giving me: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/demonrea/public_html/jimbob/email/index.php on line 44 You are not Authorized for access ___________________________- Can sum1 PLEASE TELL me whats going on?

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!