Re: Displaying Results on different rows in tables

From: Date: Fri, 19 Jan 2007 13:24:38 +0000
Subject: Re: Displaying Results on different rows in tables
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-247416@lists.php.net to get a copy of this message
Ah, I see. In Brad's reply there was two $result = mssql_query($sql) or die(mssql_error()); in the code. Removed the one from outside of the loop and it works fine now. Thanks to both of you for your help! On 1/18/07, Chris <dmagick@gmail.com> wrote:
Dan Shirah wrote: The code above displays no information at all. What I want to do is: 1. Retrieve my information 2. Assign it to a variable 3. Output the data into a table with each unique record in a seperate row As Brad posted: echo "<table>"; while ($row = mssql_fetch_array($result)) { $id = $row['credit_card_id']; $dateTime = $row['date_request_received']; echo "<tr><td>$id</td><td>$dateTime</td></tr>"; } echo "</table>"; If that doesn't work, try a print_r($row) inside the loop: while ($row = mssql_fetch_array($result)) { print_r($row); } and make sure you are using the right id's / elements from that array. -- Postgresql & php tutorials http://www.designmagick.com/


« previous php.general (#247416) next »