note 13040 deleted from function.mysql-num-rows by philip

From: Date: Wed, 18 Dec 2002 03:29:36 +0000
Subject: note 13040 deleted from function.mysql-num-rows by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-41036@lists.php.net to get a copy of this message
<? MYSQL_CONNECT($hostname, $username, $password) OR DIE("Unable to connect to database"); @mysql_select_db("$dbName") or die( "Unable to select database"); ?> <? $query = mysql_query("SELECT * FROM $usertable WHERE $metode LIKE '%$search%' LIMIT 0, 30 ")or die(''); $num_rows = mysql_num_rows($query); echo "<center>Your search criteria returned $num_rows rows from the database</center>"; while ($row = mysql_fetch_array($query) or die('')) { $variable=row"[id"] ; ........ } echo $variable ; In this way one can know how many rows were returns and than manipulate the result . sultan zahir khan

« previous php.notes (#41036) next »