I am new to database driven applications and I have some basic questions. Do the following commands belong to PHP or MySQL?
mysql_query("select * from guestbook")
mysql_fetch_array($result)
mysql_free_result($result);
mysql_query("select * from guestbook")
And if I suppose the above commands are based on PHP, does this mean that PHP offers different commands for each individual database? What if for example I want to connect to SQL or Oracle database?
Does PHP offers commands for all the databases in the world?
The above commands have been taken from the following Demo PHP script.
Code: Select all
<?php include("dbconnect.php"); ?>
<h2>View My Guest Book!!!</h2>
<?php
$result = mysql_query("select * from guestbook") or die (mysql_error());
while ($row = mysql_fetch_array($result))
{
echo "<b>Name:</b>";
echo $row ї"name"];
echo "<br>\n";
echo "<b>Email:</b>";
echo $row ї"email"];
echo "<br>\n";
echo "<b>URL:</b>";
echo $row ї"url"];
echo "<br>\n";
echo "<b>Comments:</b>";
echo $row ї"comments"];
echo "<br>\n";
echo "<br>\n";
echo "<br>\n";
}
mysql_free_result($result);
?>