MadnessRed Posted June 23, 2008 Share Posted June 23, 2008 I want a table with a lot of rows, one for each line of the database. here is what I have that would display the first line // Lets select the table $tblsites = $prefix.'sites'; $id = 1; $result = mysql_query("SELECT * FROM '$tblsites' WHERE ID='$id'"); while($row = mysql_fetch_array('$result')) { $ratecalc = ($row['Rating'] / $row['Ratings']); $rateround = round($ratecalc, 2); echo '<tr>'; echo '<td align="center">'.$row['Name'].'<br /><img src="'.$row['Image'].'" border="0" width="128" height="102" /></td>'; echo '<td>'.$row['Description'].'</td>'; echo '<td align="center">Rating: '.$rateround.'/5<br><a href="'.$link.'brokensite.sql.php?ID='.$ID.'" target="_new">Report Broken Link</a></td>'; echo "<br />"; } how could I display that for every lines, rather than just the line where ID = 1 Quote Link to comment Share on other sites More sharing options...
FlyingIsFun1217 Posted June 23, 2008 Share Posted June 23, 2008 one for each line of the database. What exactly do you mean by this...? FlyingIsFun1217 Quote Link to comment Share on other sites More sharing options...
MadnessRed Posted June 23, 2008 Author Share Posted June 23, 2008 i mean I have a table that says, for example because tis not fully filled in yet ID Name url Image Description Rating Ratings Broken 1 MadnessRed http://madnessred.co.cc/ http://madnessred.co.cc/img/siteprev.jpg My Website 5 1 0 2 Google http://www.google.co.uk/ NULL A good search engine 7 2 0 now the code I posted would make a table with 1 line showing ID1, madnessred.co.cc How can i make it so the (html) table has more lines and shows the entire table? Quote Link to comment Share on other sites More sharing options...
MadnessRed Posted June 23, 2008 Author Share Posted June 23, 2008 don't worry, I just realized how stupid I sound in that last post. I didn't realize what while did so the code would work by just removing the ID part. complete noob I am 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.