|
I am learning php with my sql and I created on my server a dummy database with 3 tables.
I am trying to connect via this code and to retrieve results from my table shops :
<?php
$db = mysql_connect("MySQLHost", "u70150339", "260052");
mysql_select_db("d60146517", $db);
$query = "SELECT * FROM shops";
$result = mysql_query($query);
while ($record = mysql_fetch_row($result)) {
for ($i=0; $i<count($record); $i++) {
echo $record[$i]."<br>";
}
echo "<br>";
}
?>
Did I forget anything? That's the answer I get:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /mnt/web_h/d26/s38/b01e75e9/www/php/Connect.php on line 15
|