Good day for all, i have some question about MySQL database..
i have code
in "connect.php" i choose my host,pass,login and database...
$mysql_host="mysql-cossacks.x10hosting.com";
all right,but i have ERROR "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in "... i tested this code in local machine and it work
Somebody help me plz(
i have code
Code:
<? include "connect.php";?>
<?
mysql_select_db ("$my_database");
$string=$_POST['string'];
if (!empty($string))
{
mysql_query("INSERT INTO test(phrase) VALUE('$string')");
}
?>
<?
$query = "SELECT phrase FROM test";
$result = mysql_query($query);
$i=0;
while ($row = mysql_fetch_array($result)) {
$arr[$i]=$row['phrase'];
$i++;
}
$rand=rand(0,$i-1);
?>
<div align=center><img src="bigheart.gif"></div>
<div style="position: absolute; top: 299px; left: 145px;right:145px; font-family: Arial; font-style: normal; font-variant: normal; font-weight: bold; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; color: rgb(0, 0, 0);"><?php echo "$arr[$rand]";?></div>
$mysql_host="mysql-cossacks.x10hosting.com";
all right,but i have ERROR "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in "... i tested this code in local machine and it work
Somebody help me plz(