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
9
Other forums
small inaccuracies
I have this code to convert fractional base 10 into base 2:
while($num > 0)
Code error with Index.php
Error: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/runevid/public_
BackButton Behaviour in AJAX
I have an ASPX Page AJAX Enabled!The page has a gridView and a DDL for filtering on it. The Gridview
URL Rewrite issue
Im created a series of Rewrites and on page checks to make sure the correct url is being called. But
Best way to read this text file.
Hi.I am planning to make a small application in C# to convert the players from Football manager 2010
Calender Not Opening
The following code is not loading the javascript calender in another window. It's not doing anything
weeks in a year
hi,
i found this snippet on php.net
QuoteFor the week number for weeks starting on Sunday:
Help uploading .JPG
I have a problem with upload images when the ending is .JPG capitalized.. I really don't know what c
How to make URL loads only on login
On my page, when a user login he's redirects to user_home.php. I made it also to open the chat scree
empty() error
Why does
Code: empty($USER_ID = $_SESSION["USER_ID"])
create this error...