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 Quote 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 Quote 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 Quote 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 anieshjoseph@gmail.com Quote Link to comment https://forums.phpfreaks.com/topic/55568-solved-stupid-question/#findComment-274544 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.