Code: Select all
<html>
<head>
<title>test</title>
</head>
<body>
begin to call the db:
<br />
<?php
//connect to the server
$link = mysql_connect("localhost", "cent", "")
or die("Could not connect");
//select the database
mysql_select_db("dbtree") or die("Could not select database");
//run the query
$sQuery = "select * from tbltree";
$result = mysql_query($sQuery,$link) or die("Query failed");
echo extract(mysql_fetch_assoc($result));
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo $lineї"Caption"];
}
?>
</body>
</html>thanks!!!