RynMan Posted April 3, 2010 Share Posted April 3, 2010 Hi guys So I'm trying to display some text from mySQL but it's only showing one of the two records in the database. Here's my code.... $resultWriters = mysql_query("SELECT * FROM `tblclientinformation` WHERE Fight = 1 ORDER BY LastName ASC ; ", $connection); if (!$resultWriters) { die("Database query failed" . mysql_error()) ; } while ($arrayWriters = mysql_fetch_array($resultWriters)){ echo ' <tr> <td> </td> <td><span class="FieldText14"> <a href="cvprofile_other.php?CVType=director&KamID='.$arrayWriters["KAMClientID"].'">' .$arrayWriters["FirstName"]." ".$arrayWriters["LastName"].'</span></a></td> <td> </td> </tr> '; } Any idea why it's only displaying one of the two records returned in my query? Quote Link to comment https://forums.phpfreaks.com/topic/197457-excluding-a-row/ Share on other sites More sharing options...
PFMaBiSmAd Posted April 3, 2010 Share Posted April 3, 2010 If that is all the relevant code, then there IS only one matching row. What does echoing mysql_num_rows($resultWriters); show? Quote Link to comment https://forums.phpfreaks.com/topic/197457-excluding-a-row/#findComment-1036409 Share on other sites More sharing options...
RynMan Posted April 3, 2010 Author Share Posted April 3, 2010 If that is all the relevant code, then there IS only one matching row. What does echoing mysql_num_rows($resultWriters); show? 2 Quote Link to comment https://forums.phpfreaks.com/topic/197457-excluding-a-row/#findComment-1036412 Share on other sites More sharing options...
PFMaBiSmAd Posted April 3, 2010 Share Posted April 3, 2010 What does a 'view source' of the page in your browser show? Quote Link to comment https://forums.phpfreaks.com/topic/197457-excluding-a-row/#findComment-1036413 Share on other sites More sharing options...
RynMan Posted April 3, 2010 Author Share Posted April 3, 2010 My apologies PFM. I found this code also occurring in there.... $arrayWriters = mysql_fetch_array($resultWriters) ; This was the cause. Thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/197457-excluding-a-row/#findComment-1036414 Share on other sites More sharing options...
PFMaBiSmAd Posted April 3, 2010 Share Posted April 3, 2010 We cannot really help you with what your code is doing when you don't post your actual relevant code. It just wastes everyones time. Quote Link to comment https://forums.phpfreaks.com/topic/197457-excluding-a-row/#findComment-1036416 Share on other sites More sharing options...
RynMan Posted April 3, 2010 Author Share Posted April 3, 2010 We cannot really help you with what your code is doing when you don't post your actual relevant code. It just wastes everyones time. I have a lot of code, and I realise when ppl post every line of code they have, it deters other from taking a look at their problem. In this case, I made a mistake and apologised for it. Thanks for your understanding. Quote Link to comment https://forums.phpfreaks.com/topic/197457-excluding-a-row/#findComment-1036417 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.