Jake Posted February 21, 2007 Share Posted February 21, 2007 When I'm making a table which is taking data from my MySQL databases... it is only printing one record... even though there are many in there. Anyone got an answer? :-( I believe this may be occurring because within the table i am trying to include data from other SQL tables, as this happened before with forums, when i was trying to include a users level, and post count. Is this why? Quote Link to comment Share on other sites More sharing options...
spellbyte ® Posted February 21, 2007 Share Posted February 21, 2007 Re: Tables... Only returning one entry? when printing a table to display DB data you dont finish off the table tag I.E. this is from my estate page <tr><td>[url='estate.php?property={$r[']{$r['hNAME']}[/url] </td><td>$$t".money_formatter($r['hPRICE'],'')."$et </td><td>{$r['hWILL']}</td></tr>"; I hope this helps u out some Quote Link to comment Share on other sites More sharing options...
Jake Posted February 21, 2007 Author Share Posted February 21, 2007 Re: Tables... Only returning one entry? I had already tried this, but it doesnt work Quote Link to comment Share on other sites More sharing options...
spellbyte ® Posted February 21, 2007 Share Posted February 21, 2007 Re: Tables... Only returning one entry? can you post the code that your having trouble with Quote Link to comment Share on other sites More sharing options...
Decepti0n Posted February 21, 2007 Share Posted February 21, 2007 Re: Tables... Only returning one entry? if you get say, all users with a in their name, and join it with, all users who have an item worth more than $70, and 40 people have an a in their name, and two people have $70 items, it'll only return the 2 IDs eg: SELECT u.*, a.* FROM users u, items a WHERE u.id = a.ownerID AND a.price > 70 AND u.name LIKE '%a%' would return the 2 people (i think, wrote it quickly) Quote Link to comment Share on other sites More sharing options...
Cronus Posted February 22, 2007 Share Posted February 22, 2007 Re: Tables... Only returning one entry? you need while($r=mysql_fetch_array($othermysqlquery)) { Information you want printed on each user } after your query Quote Link to comment Share on other sites More sharing options...
Jake Posted February 22, 2007 Author Share Posted February 22, 2007 Re: Tables... Only returning one entry? i discovered that i could just join the tables i need to use. Quote Link to comment 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.