Help - Search - Members - Calendar
Full Version: Not Displaying Values
Zymic Webmaster Forums > Zymic Free Web Hosting > Databases & MySQL
Noobkiller
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";
?>
Noobkiller
^ bump
swordz
QUOTE(Noobkiller @ Nov 8 2008, 01:25 AM) *
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
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.