order by date not ID number help php


Posted on 16th Feb 2014 07:03 pm by admin

I am trying to orginize the following code to order by date not id number.
any help would be great

Code: [Select]<?php

// Status
// 1. inshop
// 2 in progress
// 3 pending
// 4 to be picked up
// 5 Done. Out of office.

$db = mysql_connect("x","x","x") or die("Couldn't connect");
mysql_select_db("x",$db) or die("Couldn't select database");
$query="SELECT * FROM `calls` WHERE `status` = '1' AND `priority` != 1";
$result=mysql_query($query);
$num=mysql_numrows($result);

print '<table width="100%" border="0">';
print "<tr><td><b>In Shop: $num
</b></td></tr>";
$i=0;
while ($n < $numa) {
$customer=mysql_result($result_customer,$n,"name");
$n++;
};
$id=mysql_result($result,$i,"id");
$date=mysql_result($result,$i,"date");
$time=mysql_result($result,$i,"time");
$customer=mysql_result($result,$i,"customer");
// $worksheetnum=mysql_result($result,$i,"worksheetnum");
// $worksheetnum =mysql_result($result2,$i,"($_POST['worksheetnum'])");
$worksheet=mysql_result($result,$i,"worksheet");
#Find customer name out of customer field
$query_customer="SELECT `name` FROM `customers` WHERE `id` = $customer";
$result_customer=mysql_query($query_customer);
$numa=mysql_numrows($result_customer);
$n=0;

while ($n < $numa) {
$customer=mysql_result($result_customer,$n,"name");
#end
//View Inshop

print '<FORM ACTION="GWS_online_lookup.php" method=post>';
print "<tr><td width=11%><input type="hidden" name="wo" value=$id><input type="submit" value="View"/>";
print "</td>";
print '<td align="left" width="29%">';
// print '<b><h3>';
print "$customer";
// print '</b></h3>';
print '</td><td width="24%">';
// print '<b><h3>';
print "$date";
// print '</b></h3>';
print '</td><td width="20%">';
// print '<b><h3>';
print "$time";
// print '</b></h3>';
print '<td width="16%">';
// print '<b><h3>';
print "WS $id";
// print '</b></h3>';
print '</td>';
print '</form>';
$n++;
};
// $i++;
// };
print "</table>";
$worksheetnum = trim(stripslashes($_POST['worksheetnum']));
$customerid = trim(stripslashes($_POST['customerid']));
$id = $_POST['wo'];
print $worksheetnum;
print "<input type="hidden" name="worksheetnum" value=$worksheetnum>";
print "<input type="hidden" name="customerid" value=$customerid>";
print "<input type="hidden" name="wo" value=$id>";

?>

No comments posted yet

Your Answer:

Login to answer
115 Like 9 Dislike
Previous forums Next forums
Other forums

Problem in back link
I have page where i have given javascript back link but when i click on it browser give a message

ALV sum various columns problem
Hi all,
I'm doing a report on ABAP for a timesheet of the current month. The output i want is s

standard ALV application toolbar, into custom report....
HI,

I have a question regarding displaying standard ALV menu path and application toolbar

have trouble in a if condition
The if below is working ok, it check when indexes, name, zipcode and state are empty.
Code: &

RSS feed - FeedList for WordPress
Hi,

I'm trying to alter the FeedList plugin for WordPress so that I can click on the title of

Fatal error: Call to a member function fetchrow() on a non-object in C:xamppht
okay i have this query and everytime i add `item_id`=? to it... it gives me the error in the title..

batch file not building to webapps folder
Hello. I just started running Vista :P and can't seem to get my projects deployed. I found out how

UTL File problem
Hi
I have a file in certain path with the following permissions (The file is a dummy file witho

images aren't rendering
I'm trying to call a JPG file from within PHP (in an effort to hide the actual JPG folder). The imag

Trouble checking SESSION cookie
I am trying to use $_SESSION cookies to verify admin privileges .
I don't understand why this is

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash