HAVOCWIZARD Posted June 14, 2007 Share Posted June 14, 2007 in a query i get the result. how can i move the pointer inside the result to the next record ? example $record1 = ($result['field_name']); //hotel if ($record1 = "hotel") {skip or jump or what do i need here} // go to next record and check else { echo ($record1); } what will work here, i anybody can help, thanks Link to comment https://forums.phpfreaks.com/topic/55568-solved-stupid-question/ Share on other sites More sharing options...
harristweed Posted June 14, 2007 Share Posted June 14, 2007 look in php manual for: continue Link to comment https://forums.phpfreaks.com/topic/55568-solved-stupid-question/#findComment-274538 Share on other sites More sharing options...
HAVOCWIZARD Posted June 14, 2007 Author Share Posted June 14, 2007 thanks Link to comment https://forums.phpfreaks.com/topic/55568-solved-stupid-question/#findComment-274540 Share on other sites More sharing options...
aniesh82 Posted June 14, 2007 Share Posted June 14, 2007 Hello The best way is to use any of the fetch function like : mysql_fetch_array() mysql_fetch_row() mysql_fetch_object() Ex: $result = mysql_query("Select * from tablename"); while($data=mysql_fetch_array($result)) { check whether $data['field name'] equals } You can do this by using mysql_data_seek ( resource $result, int $row_number ) Find the total rows by using mysql_num_rows() and go use a for loop to go to each record. More abt Mysql functions: http://au3.php.net/mysql Regards Aniesh [email protected] Link to comment https://forums.phpfreaks.com/topic/55568-solved-stupid-question/#findComment-274544 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.