Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Linux, Apache, MySQL > MySQL Help

MySQL Help Post any question relating to MySQL here and hopefully someone can help

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2006-02-16, 11:10 AM
Junior Member
 
Join Date: Feb 2006
Posts: 1
cosmicdesign
Default

Hi Everybody,

I've written a simple database and have got it all running through my website but the customer wants a different layout and I can't work out how to tell the MySQL query and Rows to go into the write Tables.

The script is:-

$query = "SELECT CONCAT(thumbnail_source) AS thumby, CONCAT(prod_name) AS prodname, CONCAT(prod_id) AS pid, CONCAT(prod_price_uk) AS pprice FROM products WHERE prod_category = 'carinterior'";
$result = @mysql_query ($query);
$num = mysql_num_rows ($result);
while ($row =
mysql_fetch_array($result, MYSQL_NUM)) {
echo '<tr valign="top"><td width="23%"><img src="';
echo stripslashes($row[0]);
echo '" width="50" height="50" border="0"></td><td width="37%"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"><font color="#CC0000">';
echo stripslashes($row[1]);
echo '
</font>Price: £
';
echo stripslashes($row[3]);
echo ".00
<a href=\"product_page.php?pid={$row[2]}\"><img src=\"images/moreinfo.gif\" width=\"167\" height=\"28\" border=\"0\"></td>";
echo '<td width="23%"><img src="';
echo stripslashes($row[0]);
echo '" width="50" height="50" border="0"></td><td width="37%"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"><font color="#CC0000">';
echo stripslashes($row[1]);
echo '
</font>Price: £
';
echo stripslashes($row[3]);
echo ".00
<a href=\"product_page.php?pid={$row[2]}\"><img src=\"images/moreinfo.gif\" width=\"167\" height=\"28\" border=\"0\"></td>";

}

As you can see from this, it is basically 2 columns with the same load of SQL Rows, which appears as little thumbnail with text next to it and in one row and the same in the row next to it.

Unfortunately this echo's the same information for both rows so while I have entered loads of different products they just appear as 2 below them. Can't work out how to solve this so all of the products are listed down the page in two's. Please if anybody can help me it'd be much appreatiated!

Thanks,

Neil
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.5 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.5 (a popular PHP IDE) and NuCoder 2.0 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 11:05 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.