<?php $date = ""; $driver = ""; $vreg = ""; $desti = ""; $radiotype = $_REQUEST['find']; if ($radiotype == "") { echo"<p class='bodytxt'>N.B: You can filter by selecting any of the category of movement log you want to view.</p><br><br> "; exit(); } if($radiotype == "driver") { $date_out = ""; $date_in = ""; $date_out = $_REQUEST['date_out']; $date_in = $_REQUEST['date_in']; list($d, $m, $y) = split('[/.-]', $date_out); list($ed, $em, $ey) = split('[/.-]', $date_in); $date_out = $y."-".$m."-".$d; $date_in = $ey."-".$em."-".$ed; $query = "SELECT * FROM movlog WHERE driver='$driver' BETWEEN ('$date_out') AND ('$date_in')"; $pager = new PS_Pagination($conn,$query,10,10); $accra = $pager->paginate(); while($row = mysql_fetch_assoc($accra)) $id = $row['id']; $mileage_out = $row['mileage_out']; $mileage_in = $row['mileage_in']; $vreg = $row['vreg']; $ftype = $row['ftype']; $famount = $row['famount']; $driver = $row['driver']; $vtype = $row['vtype']; $dept = $row['dept']; $date_out = $row['date_out']; $date_in = $row['date_in']; $time_out = $row['time_out']; $time_in = $row['time_in']; $tt_con = $row['tt_con']; $tf_con = $row['tf_con']; } echo " <table width='100%' align='center' border='0' cellspacing='1' cellpadding='1'> <tr> <td width='12.5' align='center' valign='middle' bgcolor='#009933' class='bodytxt'><font color='#ffffff'>$vreg</font></td> <td width='12.5' align='center' valign='middle' bgcolor='#009933' class='bodytxt'><font color='#ffffff'>$date_out</font></td> <td width='12.5' align='center' valign='middle' bgcolor='#009933' class='bodytxt'><font color='#ffffff'>$date_in</font></td> <td width='12.5' align='center' valign='middle' bgcolor='#009933' class='bodytxt'><font color='#ffffff'>$famount</font></td> <td width='12.5' align='center' valign='middle' bgcolor='#009933' class='bodytxt'><font color='#ffffff'>$driver</font></td> <td width='12.5' align='center' valign='middle' bgcolor='#009933' class='bodytxt'><font color='#ffffff'>$vreg</font></td> <td width='12.5' align='center' valign='middle' bgcolor='#009933' class='bodytxt'><font color='#ffffff'>$driver</font></td> <td width='12.5' align='center' valign='middle' bgcolor='#009933' class='bodytxt'> <a href='verxbh738hmovx3z.php?nav=view&id=$id&zy9stxyw...' target='_blank'><img src='icon/view.gif' border='0'></a></td> </tr> </table> "; ?>
3 Replies - 975 Views - Last Post: 04 January 2012 - 06:38 AM
#1
I created a filter script,but its not working,any help
Posted 04 January 2012 - 06:06 AM
Replies To: I created a filter script,but its not working,any help
#2
Re: I created a filter script,but its not working,any help
Posted 04 January 2012 - 06:18 AM
I think you missed out the opening curly brace on your while loop at line number 34 on the code that you provided.
Your code:
Notice the while statement? There's no curly brace. Add it up, and if it still does throw up an error, please do paste the error here, maybe we can help
Your code:
while($row = mysql_fetch_assoc($accra)) $id = $row['id']; $mileage_out = $row['mileage_out']; $mileage_in = $row['mileage_in']; $vreg = $row['vreg']; $ftype = $row['ftype']; $famount = $row['famount']; $driver = $row['driver']; $vtype = $row['vtype']; $dept = $row['dept']; $date_out = $row['date_out']; $date_in = $row['date_in']; $time_out = $row['time_out']; $time_in = $row['time_in']; $tt_con = $row['tt_con']; $tf_con = $row['tf_con']; }
Notice the while statement? There's no curly brace. Add it up, and if it still does throw up an error, please do paste the error here, maybe we can help

#4
Re: I created a filter script,but its not working,any help
Posted 04 January 2012 - 06:38 AM
Do no double post your questions! Use your original thread if you want to continue discussing this topic.
** Thread closed **
** Thread closed **
Page 1 of 1