Re: inserting data into columns and rows in php.

From: Date: Wed, 26 Jul 2000 11:38:20 +0000
Subject: Re: inserting data into columns and rows in php.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-8267@lists.php.net to get a copy of this message
"Thomas Edison Jr." wrote: > > Maniac, > > I think what you're trying to do is quite similar to > what i have been trying to do. Only, i wanted hust two > cells in each row. The rows to be generated > automatically according to the number of records in > the database. I have tried practically all the answers > that were posted for your questiob but none of them > had worked for me. Surprisingly, i never got a single > reply posted to my problem while u got so many :( > > Anyway, if u do find some way out, i'd appreciate u > helping me. > > thanx, > T. Edison jr. > *** Did you try : $row = mysql_fetch_array($result,MYSQL_ASSOC); asort($row); // Sort your fields reset($row); // Reset the Array echo "<table>"; while (list($field,$value) = each($row)) { // Display one row with field and value echo "<tr><th>$field</th><td>$value</td></tr>"; } echo "</table>";

« previous php.general (#8267) next »