Darkmatter5 Posted January 14, 2009 Share Posted January 14, 2009 Here's my query $query="SELECT jobs.job_number, clients.full_name, jobs.job_desc FROM jobs LEFT JOIN clients ON jobs.client_id=clients.client_id WHERE jobs.job_number LIKE '$_POST[searchtext]%' ORDER BY jobs.job_number ASC"; Here's the other code $result=mysql_query($query); $row=mysql_fetch_array($result); $count=mysql_num_rows($result); if($count<1) { echo "No results from search found!"; } else { echo "<ol>"; foreach($row as $res) { echo "<li>$row[job_number] - $row[full_name] - $row[job_desc]</li>"; } echo "</ol>"; } It only outputs the first result and it does it three times, not the 14. What's going on?? Link to comment https://forums.phpfreaks.com/topic/140866-query-only-returns-one-results-when-phpmyadmin-gives-me-14/ Share on other sites More sharing options...
chronister Posted January 14, 2009 Share Posted January 14, 2009 Try this.... <?php $result=mysql_query($query); $count=mysql_num_rows($result); echo 'There are '. $count .' rows in the result<br />'; if($count<1) { echo "No results from search found!"; } else { echo "<ol>"; while($row = mysq_fetch_array($result)) { echo '<li>'.$row['job_number'].' - '.$row['full_name'].' - '.$row['job_desc'].'</li>'; } echo "</ol>"; } ?> See if that gets you the results you expect. I added the line of "there are XX number of results".... to show what the query returned. nate Link to comment https://forums.phpfreaks.com/topic/140866-query-only-returns-one-results-when-phpmyadmin-gives-me-14/#findComment-737315 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.