Code: Select all
<?php
$user="garethna_fishacc";
$pass="<span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span>";
$db="garethna_Fishdatabase";
$link=@mysql_connect("localhost",$user, $pass);
if (! $link){
die ("Couldnt connect to mysql:".mysql_error());
}
print "<h2>Successfully connected to server</h2>\n\n";
@mysql_select_db($db)
or die ("Couldnt open $db: ".mysql_error());
print "Successfully selected $db";
$row = mysql_num_rows($result);
while ($row = mysql_fetch_array($result)) {
$your_col = $row["your_col"];
$any_other_cols = $row["any_other_cols"];
echo $your_col."<br />";
echo $any_other_cols;
}
mysql_close($link);
?>Anybody know whats wrong. New to PHP and think it may be obvious. Thanks in advance!Successfully connected to server
Successfully selected garethna_Fishdatabase
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /usr/home/garethna/public_html/printmysql.php on line 21
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /usr/home/garethna/public_html/printmysql.php on line 22