Forum Moderators: phranque

Message Too Old, No Replies

mysql connection and prinht

         

Flolondon

3:04 am on Mar 29, 2005 (gmt 0)

10+ Year Member



what have i done wrong please help

<html>
<body>
<head><title>Database<title></head>

<table>

<tr>
<td>Name</td> <td>Address</td> <td> Age</td>
</tr>

<?

$conn = mysql_connect ("localhost", "root","")
or die("Could not connect to localhost");

mysql_select_db("profile", $conn) // profile is the name of your DB
or die("Could not select database");

$ConQuery = "select * from person"; //person is the name of your table

$result = mysql_query($ConQuery) // $result holds the results of the query
or die(mysql_error());

$number_cols = mysql_num_fields($result);

while ($AdeSelectionRow = mysql_fetch_array($result, MYSQL_NUM))
{

echo "<tr><td>$AdeSelectionRow[0] </td> <td>$AdeSelectionRow[1] </td> <td>$AdeSelectionRow[2]</td></tr>";

}

echo "</table>";

?>

</body>
</html>

coopster

3:23 pm on Mar 29, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Nothing, as far as I can tell. What is it that the script is or is not doing?

Flolondon

7:29 am on Mar 31, 2005 (gmt 0)

10+ Year Member



its ok, i think i have worked it out. thanks