My prof gave out this extra credit assignment, but we haven’t even learned PHP! He set up a MySQL host and wants us to make a “site” that uses PHP to let people browse products and leave reviews on the products. We have to store the products on mySQL. Which, we also haven’t learned.
I want these extra credit points, but jeez!
Here’s what I have now, after going through php tutorials for the last week, and it’s just displaying a big, fat blank white page. Ugh.
[php]<?php
// Connects to your Database
$connection = mysql_connect(“sqlHost”, “idname”, “password”);
mysql_select_db(“databaseName”, $connection);
$sql = “SELECT * FROM tableName”;
$result = mysql_query($sql, $connection) or die(mysql_error());
while ($resultArray = mysql_fetch_array($result)){
$id = $resultArray[‘Name’];
echo $id;
}
?>[/php]