Re: syntax help

From: Date: Thu, 14 Dec 2000 11:36:03 +0000
Subject: Re: syntax help
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-30285@lists.php.net to get a copy of this message
Hi Jacky, I have the same piece of code but try adding @ infront of mysql_ statements, if you want to handle the errors rather than system informs about the errors and warnings. Jacky wrote: > Hi all, > This is perhaps pretty simple for experienced php guys. I was trying to do the > "next/previous" menu to display list of search results. And after I ran the query, I got > the message error as shown below: > "Waring: 0 (mean zero) is not Mysql result index in ..... line 141" > > And the error is directed to the part of my code as shown here: > $perPage = 10 ; > > if (!$page) { > $page = 1; > } > > $prePage = $page - 1 ; > $nextPage = $page + 1; > > $pageStart = (($perPage * $page) - $perPage)+1; > > $queryoffers = "select * from TABLENAME where id ='$id'"; > $queryoffers = $queryoffers . "LIMIT $pageStart, $perPage"; > $resultofrs = mysql_query($queryoffers); > $numRows = mysql_num_rows($resultofrs); > if (($numRows) > 0) { file://<--------------This is line 141 > while($row = mysql_fetch_array($resultofrs)) > { > ....the html bit to display the results found. > } > } else { > echo " not found "; > } > > Can anybody please guide me what is the problem? and what is the correct way to do it? > Jack > jacky@activelifestyle.com > "Power is nothing without control

« previous php.general (#30285) next »