$OrderId = (int) $_REQUEST["OrderId"]; 
// query one of two
$sql = 'select * from mickey.mouse where OrderId='.$OrderId ;
$result = mysql_query($sql) or die('Query failed'.mysql_error());

$orderID_Passed =1;

echo "test2<br/>";

$numfields = mysql_num_fields($result);
echo $numfields ;
echo "<br/>";
echo "<table><table cellpadding='4' cellspacing='3' border='1'>";

$orderID_Passed = 1  ; //replace with the request object value.

$sql = "SELECT orderID, entrytime, advertiser, contactname, contactemail, billingaddress, billingcity, billingstate, billingzip, accountexecutive, aeemail, aeextphone, accountnumber, contactphone, contactfax, nrirep, nriemail, clientwebsite, clickthroughurl, adelements, campaignreports, additionalinfo, assignedto, workpath, status, submittedby, rev, lastupdate, approved  FROM nritask2.insertionorder  WHERE = $orderID_Passed";

$sql = 'SELECT *  FROM mickey.mouse WHERE orderID = '.$orderID_Passed;
echo 'ok 1   $sql='.$sql;

//$query = mysql_query($sql );
$result = mysql_query($sql) or die('Query failed'.mysql_error());

//while($row = mysql_fetch_array($result))
echo '<font color="#0000FF" >';
echo "<tr>

echo '</font>';

while($row = mysql_fetch_assoc($result) )
/*while( list($orderID, $entrytime, $advertiser, $contactname, $contactemail, $billingaddress, $billingcity, $billingstate, $billingzip, $accountexecutive, $aeemail, $aeextphone, accountnumber, contactphone, contactfax, nrirep, nriemail, clientwebsite, clickthroughurl, $adelements, $campaignreports, $additionalinfo, $assignedto, $workpath, $status, $submittedby, $rev, $lastupdate, $approved  )) = mysql_fetch_row($query)) {
echo "<tr>

echo "</table>";

I really need to make this into a vertical table with the headers still attached but I'm not sure how? Can anyone please help it's due soon!

I don't usually give out answers to homework as you're suppose to be learning this so here's a hint: tr = table row, td = table data (a cell), th = table header. If you need to make everything vertical, what is causing you to have 2 rows right now?

Think of a table like you're working inside of MS Excel and it should make sense as to what's going on.

commented: please don't assume just because the question is basic that I'm trying to cheat on homework. Not only is it rude but you look stupid when you're wrong. +0

Not homework but thank you I actually ended up rewriting the entire code to get it to do what I wanted. My school doesn't offer a PHP class that's why I needed help from here.