Jump to content

Recommended Posts

Ok well I have my script set up so that it will echo out 10 of the values found in a specific database table. These values are echoed into a HTML table, however at the moment they all just go in one like strait down. Im wanting to know if its possible to make it so that I could get like 4 values to appear per line then goes down to the next bit for another 4 and so on, to make 12 in total.

 

Like this:

 

{} {} {}

{} {} {}

{} {} {}

 

Instead of this:

{}

{}

{}

{}

 

Heres the script at the moment:

 

<?php
require("../includes/config.php");
echo "$open";
	$ucusername = ucfirst($username);
echo "<h1>$ucusername's House Storage</h1>";
$query = mysql_query("SELECT * FROM storage WHERE userid='$id' LIMIT 10");
while($rows = mysql_fetch_array($query))
	{
	$itemid = $rows['itemid'];
	$itemsquery = mysql_query("SELECT * FROM items WHERE id='$itemid'");
	while($rows2 = mysql_fetch_array($itemsquery))
		{
		$itemimage = $rows2['image'];
		$itemname = $rows2['name'];
		$itemdescription = $rows2['description'];
		}
echo<<<echo
		<center><table><tr ><td width='80'><img src='http://kurukolands.co.uk/images/items/$itemimage'><br /></td><td><font color='green'><b>$itemname</b></font></td></tr></table></center>;
echo;
	}
echo "$close";
?>

Link to comment
https://forums.phpfreaks.com/topic/174441-php-table-question/
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.