-
Resource id#5 when retrieving a SELECT statement
Hi all, I have wasted many hours trying to resolver this problem but with no luck.
I am trying to echo an email address from a database onto a page, but whenever i echo the variable Resouce id#5 is displayed:
Below is the coding I have used:
$username = $_SESSION['username'];
$query2 = mysql_query("SELECT email FROM customer WHERE username ='".$username."'");
$password = $query2;
Email Address: <? echo $password; ?>
Any help would be greatly appreciated as I have no idea how to resolve this problem
Kind regards Andy
-
Ok I realise that i have missed the 'mysql_fetch_assoc' quote again when i display the variable "array is displayed.
$username = $_SESSION['username'];
$query2 = mysql_query("SELECT email FROM customer WHERE username ='".$username."'");
$password = mysql_fetch_assoc($query2);
<? echo $password; ?>
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
|
Bookmarks