So, here it is:
On my computer I have Apache2 with PHP5..
I'm writing all my codes on this system.
So I built a simple code with mysql_fetch_array().. On my Comp. it works great,
but when i uploaded it to some hosting company (who uses php5 too) it dosent work.
Here is my code:
PHP Code:
<?php
$link = mysql_connect ($dbhost, $dbusername, $dbpass)
or die ("Can not connect to MySQL");
if (mysql_select_db ($dbname)) {
$result = mysql_query ("Select * from GuestBook order by gb_index desc");
if (mysql_affected_rows() == 0) {
echo "<font face='Arial' size='2'>àéï ëøâò øòéåðåú.</font>\n";
} else {
while ($row = mysql_fetch_array ($result)) {
echo "<html dir='rtl'>\n";
echo "<p>\n";
echo "<table dir='rtl' align='center' cellspacing='5' bgcolor='#e9e9e9' border=0 width='70%'style='font: 8pt verdana, geneva, lucida, arial, helvetica, sans-serif;'>\n";
echo "<tr><td align=right>\n";
echo "<b>îàú:</b>\n";
echo "<br>".$row["name"]." <br>\n";
echo "<b> ôåøñí á: </b>\n";
echo "<br>".$row["date"]." <br><br>\n";
echo "<b> äøòéåï: </b>\n";
echo "<br>".$row["message"]."\n";
echo "</tr></td></table>\n";
echo "</html>\n";
}
}
} else {
echo "<font face='Arial' size='2'>An error occured will trying to select the database.</font>\n";
}
mysql_close ($link);
?>
Returns the next error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home2/yazamim/webapps/htdocs/ideas/admin1.php on line 43
Line 43:
PHP Code:
while ($row = mysql_fetch_array ($result)) {
Can anyone help me?