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.