Jump to content

Display all of a table as a table.


MadnessRed

Recommended Posts

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.