I'm in the early stages of creating a website for product reviews. I've set up an SQL database in PHPMyAdmin and have successfully managed to select the data and display it in the browser. Here is the code:
Code: Select all
<?php
$con = mysql_connect("host","username","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("database", $con);
$result = mysql_query("SELECT Row FROM Table");
while($row = mysql_fetch_array($result))
{
echo $row['Row'];
echo "<br /><hr />";
}
mysql_close($con);
?>
Thanks!