View Full Version : mysql error

09-14-2011, 10:24 PM
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /path/public_html/account.php on line 21

<?php session_start(); ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Account Dashboard</title>

$con = mysql_connect("$host","$user","$password");
if (!$con)
die('Could not connect: ' . mysql_error());

mysql_select_db("$db", $con);

$result = mysql_query("SELECT * FROM $tbl_name" );

while($row = mysql_fetch_array($result))
echo $row['FirstName'] . " " . $row['LastName'];
echo "<br />";

<a href="logout.php"> Log Out </a>

09-14-2011, 10:51 PM
I am not seeing $tbl_name defined anywhere. That would be a problem

$result = mysql_query("SELECT * FROM $tbl_name");

Also are you going to use WHERE in the query? I always prefer it.

09-14-2011, 10:58 PM
Okay it works like a charm, but since i md5 everything when user registers, when i retrieve it from the database, how do I un-md5 it so when the user looks at it, it doesn't appear as gibberish?

09-14-2011, 11:22 PM
See the other thread you have opened regarding this.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum