ksduded Posted March 10, 2009 Share Posted March 10, 2009 I have a search function which takes input from the user and then goes through my records searching in a few fields for the keyword and then prints out the results. $resulttime picks up the timings from a field called prog_time2 $sql is my search query (which seems to be working fine) $resulttime = mysql_query("SELECT *, TIME_FORMAT( prog_time, '%l:%i %p') AS prog_time2 from rushhd_schd"); $sql = "SELECT * FROM rushhd_schd WHERE prog_programname LIKE '%{$string}%' OR prog_episodename LIKE '%{$string}%' OR prog_episodedesc LIKE '% {$string} %' ORDER BY prog_date ASC"; $query = mysql_query($sql); while ($info = mysql_fetch_array($query)) { //echo out the results { $ptime = mysql_fetch_array($resulttime); ...... The problem is that even though the search is picking up the right records, my resulttime is not picking up the data from the field associated with that record. It just picks up the field from the first record. Which is quite evident from my coding.... How should I change it so that my resulttime only picks up the prog_time field from only the searched query. Thank you Link to comment https://forums.phpfreaks.com/topic/148843-search-not-working-properly/ Share on other sites More sharing options...
ksduded Posted March 12, 2009 Author Share Posted March 12, 2009 *bump* Is it very confusing? Link to comment https://forums.phpfreaks.com/topic/148843-search-not-working-properly/#findComment-782998 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.