Re: diferent data on diferent columns...
| From: | Romeo Manzur | Date: | Mon, 19 Nov 2001 22:33:16 +0000 |
| Subject: | Re: diferent data on diferent columns... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-75162@lists.php.net to get a copy of this message | ||
I found the way...
$i = 0;
$result = mysql_query("SELECT * FROM sometable");
echo " <tr> \n";
while($row = mysql_fetch_array($result)){
echo " <td>".$row[id]."</td>\n";
if($i % 2 == 1){
echo " </tr>\n";
echo " <tr>\n";
}
$i++;
}
echo " </tr>\n";
I hope that this can help to somebody...
Romeo Manzur wrote:
> Hi, I wonder how could I do a script for print direfent data on
> diferents columns from a table...
> I mean this
> $result = mysql_query("SELECT * FROM xxx");
> while(($row = mysql_fetch_array($result)){
> echo "<table>
> echo " <tr>
> echo " <td>".$row[id]."<td>\n";//id for the firt record
> ex:1
> echo " <td>".$row[id]."<td>\n";//id for the second
> record ex: 2
> echo " </tr>\n";
> echo "</table>\n";
>
> if I do this it prints the same record value...
>
> please I need help...