|
Posted by Jeff North on 04/26/07 12:17
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
---------------------------------------------------------------
[Back to original message]
|