User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 374,159 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,442 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting

a little help

Join Date: Jan 2008
Posts: 76
Reputation: rickarro is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
rickarro rickarro is offline Offline
Junior Poster in Training

a little help

  #1  
May 7th, 2008
I'm trying to get this script to work and it is only giving me a blank white page, can someone take a look at it and see if you can tell whats wrong with it.
<?php
// Show simple format of the records so person can choose the reference name/number
// this is then passed to the next page, for all details

$host = "localhost"; 
$user = "xxx"; 
$pass = "xxx"; 
$db = "phonebook"; 

//Connecting to MYSQL
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");

//Select the database we want to use
mysql_select_db($db) or die ("Could not find database");

// Get all records in all columns from table and put it in $result.
$query = "SELECT * FROM people"; 

// execute query 
$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); 

// Get all records in all columns from table and put it in $result.
$result=mysql_query("select * from people");

/*Split records in $result by table rows and put them in $row.
Make it looping by while statement. */
while($row=mysql_fetch_assoc($result)){

// Output
echo "ID : $row['id'] <br/>";
echo "First Name : $row['fname'] <br/>";
echo "Last Name : $row['lname'] <br/>";
echo "Phone Number : $row['phone_num'] <br/>";
echo "Extension : $row['ext'] <br/>";
echo "Title : $row['title'] <br/>";
echo "Department : $row['dept'] <br/>";
echo "Fax Number : $row['fax'] <hr>";

// Add a link with a parameter(id) and it's value.
echo '<a href="phoneupdate1.php?id='.$row['id'].'">Update</a>';

}

mysql_close();
?>
I must be missing something simple but I just can't find it. This is a form to update a record in a MySQL database.

Thanks.
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 3:40 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC