Advertisement
cdsatrian

datediff

Apr 22nd, 2013
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. //..
  2. $tanggal=$_POST['thn_minta'].'-'.$_POST['bln_minta'].'-'.$_POST['tgl_minta'];
  3. $sql="SELECT * FROM inbox WHERE DATEDIFF(`ReceivingDateTime`,'$tanggal')=0 ORDER BY ID DESC";
  4. $result=mysql_query($sql);
  5. if($result=mysql_query($sql)){
  6.   if(mysql_num_rows($result)){
  7.     $i=0;
  8.     while($row=mysql_fetch_array($result)){
  9.       $cell[$i][0]=date('d M Y',strtotime($row['ReceivingDateTime']));
  10.       $cell[$i][1]=date('H:i',strtotime($row['ReceivingDateTime']));
  11.       $cell[$i][2]=$row['SenderNumber'];
  12.       $cell[$i][3]=$row['TextDecoded'];
  13.       $i++;
  14.     }
  15.   } else{
  16.     exit('no record found');
  17.   }
  18. } else{
  19.   exit('check your sql query');
  20. }
  21. //...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement