MySql & Php on Win2000

admin

Administrator
Staff member
I am using MySql,php,on a win2000 system.
I am a very newbee in Austin, Texas.
Every thing is set up and working fine except my knowledge of php.
I got some code off this site and have altered it to fit me needs - but I made some mistake and the following code almost works!

I get this from the following code:

Please follow the lin: <!-- m --><a class="postlink" href="http://www.jjmc.com/jjmcmy/test.php">http://www.jjmc.com/jjmcmy/test.php</a><!-- m -->


<?php

// create connection
$connection = mysql_connect("localhost","jerry","122248");

// test connection
if (!$connection) {
echo "Couldn't make a connection!";
exit;
}

// select database
$db = mysql_select_db("owner", $connection);

// test selection
if (!$db) {
echo "Couldn't select database!";
exit;
}

// create SQL statement
$sql = "SELECT * FROM own";

// execute SQL query and get result
$sql_result = mysql_query($sql,$connection);

// start results formatting
echo "<TABLE BORDER=4>";
echo "<TR><TH>Property</TH>
<TH>Address</TH>
<TH>Zip</TH>
<TH>Type</TH>
<TH>SqFt</TH>
<TH>Bedrooms</TH>
<TH>Baths</TH>
<TH>Aminities</TH>
<TH>Rent</TH>
<TH>Deposit</TH>
<TH>Available</TH></TR>";

// format results by row
while ($row = mysql_fetch_array($sql_result))
{
$Property = $row["property"];
$Address = $row["address"];
$Zip = $row["zip"];
$Type = $row["type"];
$SqFt = $row["sqft"];
$Bedrooms = $row["bedrooms"];
$Baths = $row["baths"];
$Aminities = $row["aminities"];
$Rent = $row["rent"];
$Deposit = $row["deposit"];
$Available = $row["available"];
echo "<TR><TD>$property</TD>
<TD>$address</TD>
<TD>$zip</TD>
<TD>$type</TD>
<TD>$sqft</TD>
<TD>$bedrooms</TD>
<TD>$baths</TD>
<TD>$aminities</TD>
<TD>$rent</TD>
<TD>$deposit</TD>
<TD>$available</TD></TR>";
}

echo "</TABLE>";

// free resources and close connection
mysql_free_result($sql_result);
mysql_close($connection);
?>

Thank for any help!
Jerry
 
Back
Top