Hi all !
I am moving my database from MySQL server version 3.23.56 to version 4.0.15 (different webhost) and I get problem in executing my queries :
=========
<---------Some html codes--------->
<?
mysql_connect("localhost","myusername","mypassword");
mysql_select_db("parlemen_com");
$qry = mysql_query("SELECT partai FROM partai WHERE partai LIKE '%$caripartai%'"); \\<--This variable is passed from another page !
$jml = mysql_num_rows($qry);
?>
<p align="center"><font face="Verdana" size="2" color="#400000">There are <b><? echo $jml ?></b> items that match your search!</font></p>
<font face="Verdana" size="2">
<? while($row = mysql_fetch_row($qry)) {
echo "<a href='datapartai.php?partai=";
echo $row[0];
echo "'>";
echo "PARTAI ";
echo $row[0];
echo "</a>";
echo "<br>";
}
?>
=========
The above queries worked fine in version 3.23.56 and returned the desired results e.g. (1) the number of items matching with the search query, and (2) the list of the items.
But on the MySQL v. 4.0.25 it returned error message :
========
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/partai/public_html/php/hasilpencarian.php on line 13
There are that macth your search!
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/partai/public_html/php/hasilpencarian.php on line 19
============
From the MySQL documentation I learned that the current version uses additional API functions : mysql_store_result() and mysql_use_result() in assosiation with the use of mysql_num_rows() and mysql_fetch_rows().
Could somebody help me with the codes please ? My knowledge on the programming code is very limited.
Thank you very much. I would really appreciate your help.
-toean-
I am moving my database from MySQL server version 3.23.56 to version 4.0.15 (different webhost) and I get problem in executing my queries :
=========
<---------Some html codes--------->
<?
mysql_connect("localhost","myusername","mypassword");
mysql_select_db("parlemen_com");
$qry = mysql_query("SELECT partai FROM partai WHERE partai LIKE '%$caripartai%'"); \\<--This variable is passed from another page !
$jml = mysql_num_rows($qry);
?>
<p align="center"><font face="Verdana" size="2" color="#400000">There are <b><? echo $jml ?></b> items that match your search!</font></p>
<font face="Verdana" size="2">
<? while($row = mysql_fetch_row($qry)) {
echo "<a href='datapartai.php?partai=";
echo $row[0];
echo "'>";
echo "PARTAI ";
echo $row[0];
echo "</a>";
echo "<br>";
}
?>
=========
The above queries worked fine in version 3.23.56 and returned the desired results e.g. (1) the number of items matching with the search query, and (2) the list of the items.
But on the MySQL v. 4.0.25 it returned error message :
========
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/partai/public_html/php/hasilpencarian.php on line 13
There are that macth your search!
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/partai/public_html/php/hasilpencarian.php on line 19
============
From the MySQL documentation I learned that the current version uses additional API functions : mysql_store_result() and mysql_use_result() in assosiation with the use of mysql_num_rows() and mysql_fetch_rows().
Could somebody help me with the codes please ? My knowledge on the programming code is very limited.
Thank you very much. I would really appreciate your help.
-toean-