Romsky
08-06-2005, 10:07 PM
Here is the code that I am using:
-------------------------
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$tr_num = $_REQUEST['tr_num'];
$result = mysql_query("select * from pack_stat WHERE tr_num=$tr_num order by updated");
echo "
<html>
<body>
<center>
<table BORDER='1' CELLSPACING='1' CELLPADDING='0' WIDTH='585' bordercolordark='#333333' bordercolorlight='#666666'>
<thead>
<td WIDTH='70'>Tracking#</td>
<td WIDTH='50'>User</td>
<td WIDTH='170'>Status</td>
<td WIDTH='95'>Date</td>
<td WIDTH='50'>Time</td>
<td WIDTH='150'>Last Updated</td>
</thead>
";
while($r=mysql_fetch_array($result)){
$tr_num=$r["tr_num"];
$user=$r["user"];
$status=$r["status"];
$date=$r["date"];
$time=$r["time"];
$updated=$r["updated"];
echo "
<tr>
".$tr_num=$r["tr_num"]."</td>
<td>".$user=$r["user"]."</td>
<td>".$tstatus=$r["status"]."</td>
<td>".date("m/d/Y",$date=$r["date"])."</td>
<td>".date("H:i",$time=$r["time"])."</td>
<td>".$updated=$r["updated"]."</td>
</tr>
";
}
?>
-------------------------
Now every time the page loads ALL dates are 12/31/1969, and the time is always 16:00.
The data exists in the tabe as follows:
Date: "2005-08-06"
Time: "17:04:00"
I want it to look like
08/06/2005
17:04
I have been able to format the data but it won't dynamically fill the table.
Please HELP!
-------------------------
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$tr_num = $_REQUEST['tr_num'];
$result = mysql_query("select * from pack_stat WHERE tr_num=$tr_num order by updated");
echo "
<html>
<body>
<center>
<table BORDER='1' CELLSPACING='1' CELLPADDING='0' WIDTH='585' bordercolordark='#333333' bordercolorlight='#666666'>
<thead>
<td WIDTH='70'>Tracking#</td>
<td WIDTH='50'>User</td>
<td WIDTH='170'>Status</td>
<td WIDTH='95'>Date</td>
<td WIDTH='50'>Time</td>
<td WIDTH='150'>Last Updated</td>
</thead>
";
while($r=mysql_fetch_array($result)){
$tr_num=$r["tr_num"];
$user=$r["user"];
$status=$r["status"];
$date=$r["date"];
$time=$r["time"];
$updated=$r["updated"];
echo "
<tr>
".$tr_num=$r["tr_num"]."</td>
<td>".$user=$r["user"]."</td>
<td>".$tstatus=$r["status"]."</td>
<td>".date("m/d/Y",$date=$r["date"])."</td>
<td>".date("H:i",$time=$r["time"])."</td>
<td>".$updated=$r["updated"]."</td>
</tr>
";
}
?>
-------------------------
Now every time the page loads ALL dates are 12/31/1969, and the time is always 16:00.
The data exists in the tabe as follows:
Date: "2005-08-06"
Time: "17:04:00"
I want it to look like
08/06/2005
17:04
I have been able to format the data but it won't dynamically fill the table.
Please HELP!