not getting all the results
Posted: Fri Nov 17, 2006 3:47 pm
i was trying to pull up all the records cor this one user based on his user name but it only pulls up one...can someone help me...heres my code
Code: Select all
<?php
session_start();
function doDB()
{
$conn = mysql_connect("######","####","######") or die(mysql_error());
mysql_select_db("customerdirectory",$conn) or die(mysql_error());
return $conn;
}
function clearsessionscookies()
{
unset($_SESSION['auth']);
unset($_SESSION['logname']);
session_unset();
session_destroy();
}
error_reporting(E_ALL);
ini_set('display_errors', 1);
$conn = doDB();
$sql = "Select * FROM merchant WHERE user_name = '{$_SESSION['logname']}'";
$result = mysql_query($sql,$conn) or die(mysql_error());
while ($newArray = mysql_fetch_array($result))
{
$merchant_num = $newArray['merchant_num'];
$date_recieved= $newArray['date_recieved'];
$merchant_name = $newArray['merchant_name'];
$bank= $newArray['bank'];
$purchase_type= $newArray['purchase_type'];
$date_submitted= $newArray['date_submitted'];
$bankap_date= $newArray['bankap_date'];
$lease_company= $newArray['lease_company'];
$app_id= $newArray['app_id'];
$hypercom_tid= $newArray['hypercom_tid'];
$lease_discount= $newArray['lease_discount'];
$amexdate_submit= $newArray['amexdate_submit'];
$amexdate_appd= $newArray['amexdate_appd'];
$shipped= $newArray['shipped'];
$terminal= $newArray['terminal'];
$serial_num= $newArray['serial_num'];
$nms= $newArray['nms'];
$comments= $newArray['comments'];
}
echo"
<html>
<head>
<title></title>
<link rel=\"stylesheet\" type=\"text/css\" href=\"cs.css\">
<script language=\"javascript\" src=\"myForms.js\">
</script>
</head>
<body bgcolor=\"white\">
<h3><center>Merchant Services Incorporated</center></h3>
<table width=\"1187\">
<tr>
<td>
<table class=\"text\" width=\"1174\" border=\"1\" bordercolor=\"green\">
<tr>
<td align=\"center\" width=\"75\">Date Received</td>
<td align=\"center\" width=\"81\">Merchant Name</td>
<td align=\"center\" width=\"40\">Bank</td>
<td align=\"center\" width=\"106\">Lease/Conversion/Reprogram</td>
<td align=\"center\" width=\"106\">Date Submitted</td>
<td align=\"center\" width=\"105\">Bank AP Date</td>
<td align=\"center\" width=\"111\">Lease Company</td>
<td align=\"center\" width=\"99\">Lease Discount</td>
<td align=\"center\" width=\"105\">AMEX Date Submit</td>
<td align=\"center\" width=\"109\">AMEX Date APPD</td>
<td align=\"center\" width=\"75\">Shipped</td>
<td align=\"center\" width=\"97\">Merchant Number</td>
</tr>
<tr>
<td>$date_recieved </td>
<td>$merchant_name </td>
<td>$bank </td>
<td>$purchase_type </td>
<td>$date_submitted </td>
<td>$bankap_date </td>
<td>$lease_company </td>
<td>$lease_discount </td>
<td>$amexdate_submit </td>
<td>$amexdate_appd </td>
<td>$shipped </td>
<td>$merchant_num </td>
</tr>
<tr>
<td bgcolor=\"green\" colspan=\"12\"> </td>
</tr>
<tr>
<td width=\"45\">Terminal:</td><td width=\"104\">$terminal </td>
<td width=\"73\">Serial Number:</td><td width=\"102\">$serial_num </td>
<td width=\"42\">App-ID:</td><td width=\"114\">$app_id </td>
<td width=\"29\">NMS:</td><td width=\"109\">$nms </td>
<td width=\"70\">Hypercom TID:</td><td>$hypercom_tid </td>
</tr>
<tr>
<td>Comments</td>
<td colspan=\"11\">$comments </td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>";
?>