Can’t seem to figure out what is causing an error here.
<?php
$user = "****";
$pass = "****";
$db = "***";
$link = mysql_connect("localhost", "$user", "$pass");
if (! $link)
die ("couldn't connect to MySQL");
mysql_select_db($db, $link) or die ("couldn't open $db: ".mysql_error());
$result = mysql_query("SELECT * FROM myDB WHERE id=1");
$a_row = mysql_fetch_array($result);
$num_rows =mysql_num_rows($result);
print "$num_rows Rows
"; //prints 1 Rows
print $a_row; // prints Array
//each of these below cause an error
foreach($a_row as $key => $value) {
print $key $value;
}
while ($a_row)) {
print("yes");
}
?>