Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old November 10th, 2002, 05:22 PM
iainlang iainlang is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 55 iainlang User rank is Private First Class (20 - 50 Reputation Level)iainlang User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 3 h 54 m 17 sec
Reputation Power: 6
Question I just KNOW I'm going to feel foolish....

I'm going to feel really stooopid, I suppose, when I have this explained to me....

A friend (yes, really!) runs a one-man business and I wrote his static html pages. He recently visited some database-driven on-line sites, and instantly it was - "Here, do me one of those".

Well, writing the php code and MySQL is fine (book in one hand, y'know) but I'm having trouble with the logic to get four images per line across the page, repeated down the page until the MySQL database runs out of data.

Can anyone help, please?

I've tried all kinds of permutations of the following lines -

$Query="select prod_name, reg_price from $TableName";
$Result=mysql_db_query ($DBName, $Query, $Link);
print("<table>");
while ($Row = mysql_fetch_array ($Result))
{
print("<tr>");
$td_count=1;
while ($td_count<5)
{
print ("<td>");
print ("<table>
<tr><td>$Row[prod_name]</td></tr>
<tr><td>$Row[reg_price]></td></tr>
</table>
</td>\n");
$td_count = $td_count+1;
}
print("</tr>\n");
}
mysql_close ($Link);

print ("</td></tr></table>\n");

This give me four copies of each array element per line. Duh....

TIA.

Iain.

Reply With Quote
  #2  
Old November 10th, 2002, 05:32 PM
NoXcuz's Avatar
NoXcuz NoXcuz is offline
Wiking
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Sep 2000
Location: Sweden
Posts: 3,608 NoXcuz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 49 m 27 sec
Reputation Power: 11
This should be something similar to what you want to accomplish -> http://forums.devshed.com/showthrea...&threadid=46103

BTW, people around here appreciate descriptive subject lines, so please use that in the future...

Slainthé mhath!

//NoXcuz
__________________
UN*X is sexy!
who | grep -i blonde | date; cd ~; unzip; touch; strip; finger; mount; gasp; yes; uptime; umount; sleep

Reply With Quote
  #3  
Old November 10th, 2002, 06:47 PM
iainlang iainlang is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 55 iainlang User rank is Private First Class (20 - 50 Reputation Level)iainlang User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 3 h 54 m 17 sec
Reputation Power: 6
Thanx for your swift response - I'll give it a go in the morning. (Heck, right now, it IS morning, 00.50 - mebbe why I put that silly header on.)

Yoooors,

Iain.



Quote:
Originally posted by NoXcuz
This should be something similar to what you want to accomplish -> http://forums.devshed.com/showthrea...&threadid=46103

BTW, people around here appreciate descriptive subject lines, so please use that in the future...

Slainthé mhath!

//NoXcuz

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > I just KNOW I'm going to feel foolish....


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway