You are here: Re: html table trouble « PHP Programming Language « IT news, forums, messages
Re: html table trouble

Posted by _Skare_Krow_ on 04/26/07 13:38

Jeff North wrote:
> On Thu, 26 Apr 2007 00:28:45 -0500, in comp.lang.php _Skare_Krow_
> <petra2201@gmail.com>
> <nJmdnd-T__sfpa3bnZ2dnUVZ_rGinZ2d@sysmatrix.net> wrote:
>
>> | I have a database with three columns. One is an atomic number, one is a
>> | pic url, and the other is a description. What I'm having trouble doing
>> | is putting the url in one table row and the description in another table
>> | row right below it like this...
>> | <tr> <td> some pic url</td> <td> other pic url</td></tr>
>> | <tr><td> some descripts </td> <td> other descript </td></tr>
>> |
>> | whilest limiting the rows to about 10 cells each,,....
>> |
>> | any ideas?
>> |
>> | Aaron
>
> <?php
> //--- init record limit var
> $start=0;
>
> //--- open connection to db and table
>
> //--- get page number from url/post var
> //--- and update the $start var
>
> //--- create the query
> $sql = "SELECT * FROM table LIMIT {$start},{start + 10}";
> //--- execute query
> $row1=""; $row2="";
> for($i=0; $i<count($result); $i++)
> {
> $row1 .= "<td><img src'".$result[$i]->pic_url."'</td>";
> $row2 .= "<td>".$result[$i]->pic_desc."</td>";
> }
> ?>
>
> <table>
> <tr><?php echo $row1;></tr>
> <tr><?php echo $row2;></tr>
> </table>
> ---------------------------------------------------------------
> jnorthau@yourpantsyahoo.com.au : Remove your pants to reply
> ---------------------------------------------------------------
thanks everyone.. i've got enough info to try out.. i will post back
with my success or failure :P

aaron

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация