0
<?php
echo "<table>"<table cellpadding='4' cellspacing='3' border='1'>;
$query = mysql_query("SELECT orderID, entrytime, advertiser, contactname, contactemail, billingadress, billingcity, billingstate, billingzip, accountexecutive, aeemail, aextphone, accountnumber, contactphone, contactfax, nrirep, nriemail, clientwebsite, clickthroughurl, adelements, campaignreports, additionalinfo, assignedto, workpath, status, submittedby, rev, lastupdate, approved  FROM Mickeymouse");

while(list($orderID, $entrytime, $advertiser, $contactname, $contactemail, $billingadress, $billingcity, $billingstate, $billingzip, $accountexecutive, $aeemail, $aextphone, accountnumber, contactphone, contactfax, nrirep, nriemail, clientwebsite, clickthroughurl, $adelements, $campaignreports, $additionalinfo, $assignedto, $workpath, $status, $submittedby, $rev, $lastupdate, $approved  )) = mysql_fetch_row($query)){
echo "
<tr>
<td>$orderId/td>
<td>$entrytime</td>
<td>$advertiser</td>
<td>$contactname</td>
<td>$contactemail</td>
<td>$billingaddress</td>
<td>$billingcity</td>
<td>$billingstate</td>
<td>$billingzip</td>
<td>$accountnumber</td>
<td>$contactphone</td>
<td>$contactfax</td>
<td>$nrirep</td>
<td>$nriemail</td>
<td>$clientwebsite</td>
<td>$clickthroughurl</td>
<td>$adelements</td>
<td>$campaignreports</td>
<td>$additionalinfo</td>
<td>$assignedto</td>
<td>$workpath</td>
<td>$status</td>
<td>$submittedby</td>
<td>$rev</td>
<td>$lastupdate</td>
<td>$approved</td>
</tr>";
}
echo "</table>";
?>

What I want to do is pull info from the "mickeymouse" database and input it into an easy read table? Can anybody help me fix?

Edited by Dani: Fixed formatting

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by nevvermind
0
<?php
echo "<table>"<table cellpadding='4' cellspacing='3' border='1'>;
$query = mysql_query("SELECT orderID, entrytime, advertiser, contactname, contactemail, billingadress, billingcity, billingstate, billingzip, accountexecutive, aeemail, aextphone, accountnumber, contactphone, contactfax, nrirep, nriemail, clientwebsite, clickthroughurl, adelements, campaignreports, additionalinfo, assignedto, workpath, status, submittedby, rev, lastupdate, approved FROM Mickeymouse");

while(list($orderID, $entrytime, $advertiser, $contactname, $contactemail, $billingadress, $billingcity, $billingstate, $billingzip, $accountexecutive, $aeemail, $aextphone, accountnumber, contactphone, contactfax, nrirep, nriemail, clientwebsite, clickthroughurl, $adelements, $campaignreports, $additionalinfo, $assignedto, $workpath, $status, $submittedby, $rev, $lastupdate, $approved )) = mysql_fetch_row($query)){
echo "
<tr>
<td>$orderId/td>
<td>$entrytime</td>
<td>$advertiser</td>
<td>$contactname</td>
<td>$contactemail</td>
<td>$billingaddress</td>
<td>$billingcity</td>
<td>$billingstate</td>
<td>$billingzip</td>
<td>$accountnumber</td>
<td>$contactphone</td>
<td>$contactfax</td>
<td>$nrirep</td>
<td>$nriemail</td>
<td>$clientwebsite</td>
<td>$clickthroughurl</td>
<td>$adelements</td>
<td>$campaignreports</td>
<td>$additionalinfo</td>
<td>$assignedto</td>
<td>$workpath</td>
<td>$status</td>
<td>$submittedby</td>
<td>$rev</td>
<td>$lastupdate</td>
<td>$approved</td>
</tr>";
}
echo "</table>";
?>

Firstly, that should make it A LOT easier to read. Now let me take a look at it..

Edited by Maulth: n/a

0

I'm assuming that you want the exact same order as the fields in the database table.
Check if this code works for you:

<?php
$query = mysql_query("SELECT orderID, entrytime, advertiser, contactname, contactemail, billingadress, billingcity, billingstate, billingzip, accountexecutive, aeemail, aextphone, accountnumber, contactphone, contactfax, nrirep, nriemail, clientwebsite, clickthroughurl, adelements, campaignreports, additionalinfo, assignedto, workpath, status, submittedby, rev, lastupdate, approved FROM Mickeymouse");
?>

<table cellpadding="4" cellspacing="3" border="1">

    <?php
    while ($row = mysql_fetch_row($query)) {
        echo "<tr>";
        for ($i = 0; $i < count($row); $i++) {
            echo "  <td>$row[$i]</td>\n";
        }
        echo "</tr>";
    }
    ?>

</table>

Must I remind of the "SELECT * FROM Mickeymouse" syntax?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.