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
Need help with some php code :)
Hey! I'm quite new to this whole thing, so please don't fire me with shait on this one =D
I'm
listing help
Hi,
at first, great new design!!! I like it,
i got a problem,
I want to list so
problem in program for counting no of chars using pointers
Hi all, I was trying to make a program which counts number of chars in a string using concpt of poin
I think i'm using the syntax incorrectly
Hi Everyone!
I'm new to this forum and a newbie with PHP - I'm glad I found this site - I hop
Connection Timeout
I'm using xmii 12.0
I'm calling a transaction as a web service from a windows application
Java API in PHP?
I have an application that we use internally here at the office.
The software company provide
array_diff weirdness
I'm using the following bit of code
$diff = array_diff($pids, $pidlist);
$diff = array_va
styling a RadioButtonList
HiI need to have a radio button and close to it, its lable, then a space then another set of those.
disabling a button server-side then re-enabling client-side breaks button postback
I have a tabbed container and a button (not in the container) on a page. If the first tab is selecte
Reading waves
Hi,
I am trying to find a way of finding the highs and lows on a graph line, the line points