Not Displaying Values |
||
Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.
In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.
Zymic Webmaster Forums Zymic Free Web Hosting Databases & MySQL |
||
![]() |
Not Displaying Values |
||
Nov 8 2008, 01:25 AM
Post
#1
|
|
|
Newbie ![]() Group: Members Posts: 14 Joined: 28-July 08 Member No.: 50,260 |
Hi! I'm trying to display something from my database, but no luck! Here's the code
CODE <?php
require "header.php"; ?> <body> <?php // Make a MySQL Connection mysql_connect("localhost", "admin", "password") or die (mysql_error()); mysql_select_db("booo_db") or die (mysql_error()); $query="SELECT user_password FROM users WHERE user_name='Herb'"; $result=mysql_query($query) or die (mysql_error() ); $row=mysql_fetch_assoc($result); // Print out the contents of each row into a table print $row['user_password']; ?> <?php require "footer.php"; ?> |
|
|
Nov 9 2008, 08:15 PM
Post
#2
|
|
|
Newbie ![]() Group: Members Posts: 14 Joined: 28-July 08 Member No.: 50,260 |
^ bump
|
|
|
Nov 9 2008, 09:16 PM
Post
#3
|
|
|
Outrageously Uber Ninja ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Moderators Posts: 1,805 Joined: 10-July 08 From: UK Member No.: 44,994 |
Hi! I'm trying to display something from my database, but no luck! Here's the code CODE <?php require "header.php"; ?> <body> <?php // Make a MySQL Connection mysql_connect("localhost", "admin", "password") or die (mysql_error()); mysql_select_db("booo_db") or die (mysql_error()); $query="SELECT * FROM users WHERE user_name='Herb'"; $result=mysql_query($query) or die (mysql_error() ); $row=mysql_fetch_assoc($result); // Print out the contents of each row into a table print_r($row); ?> <?php require "footer.php"; ?> Try that. It won't look good, but I'm printing all of $row, just to see what it returns. Obviously change your user name and password back first. swordz |
|
|
![]() |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users) |
||
| 0 Members: | ||
Forum Jump |
||
| Lo-Fi Version | Time is now: 24th May 2013 - 10:26 AM |