|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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. |
|
#2
|
||||
|
||||
|
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 |
|
#3
|
|||
|
|||
|
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:
|
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > I just KNOW I'm going to feel foolish.... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|