arcticvman
MIS
I am new to PHP, trying to learn on my own but I am having an issue. I am querying my mssql db and showing the return data to a table on a page, but I am having trouble converting the datetime data from mssql to just a date. I have searched the web and either I am not searching incorrectly or just don't understand. What I want to do is return the imlstrx_sql.eff_dt and imlstrx_sql.trx_dt formatted as ddmmmyyyy.
Any and all help is appreciated.
Here is what I am doing currently:
Any and all help is appreciated.
Here is what I am doing currently:
Code:
{
$query = "select imlstrx_sql.item_no AS Item_Number, imitmidx_sql.item_desc_1 AS Description, imlstrx_sql.ser_lot_no AS Serial_Number,
imlstrx_sql.ord_no AS Order_Number, imlstrx_sql.eff_dt AS Production_Date, imlstrx_sql.trx_dt AS Ship_Date,
oehdrhst_sql.cus_no AS Customer_Number, oehdrhst_sql.bill_to_name AS Customer_Name, oehdrhst_sql.ship_to_name AS Ship_to_Name
FROM dbo.imlstrx_sql imlstrx_sql INNER JOIN dbo.oelinhst_sql oelinhst_sql
ON imlstrx_sql.line_no=oelinhst_sql.line_seq_no AND imlstrx_sql.ord_no=oelinhst_sql.ord_no
INNER JOIN dbo.imitmidx_sql imitmidx_sql ON imitmidx_sql.item_no=oelinhst_sql.item_no
INNER JOIN dbo.oehdrhst_sql oehdrhst_sql ON oelinhst_sql.ord_no=oehdrhst_sql.ord_no
WHERE imlstrx_sql.ser_lot_no='880-1279' AND oelinhst_sql.loc='AS'";
$result=odbc_exec($conn, $query);
echo "<table border=\"1\"><tr>";
$colName = odbc_num_fields($result);
for ($j=1; $j<= $colName; $j++)
{
echo "<th>";
echo odbc_field_name ($result, $j );
echo "</th>";
}
while(odbc_fetch_row($result))
{
echo "<tr>";
for($i=1;$i<=odbc_num_fields($result);$i++)
{
echo "<td>";
echo odbc_result($result,$i);
echo "</td>";
}
echo "</tr>";
}
echo "</td> </tr>";
echo "</table >";
odbc_close ($conn);
}