Advertisement
Guest User

Untitled

a guest
Jul 7th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. <?php
  2. $objConnect = mysql_connect("localhost","cmsmarthom_reg","55021744");
  3. $objDB = mysql_select_db("cmsmarthom_reg");
  4. mysql_query("SET NAMES UTF8");
  5. mysql_query("SET character_set_results=utf8");
  6. mysql_query("SET character_set_client=utf8");
  7. mysql_query("SET character_set_connection=utf8");
  8.  
  9. $strDate = $_POST["sDate"];
  10.  
  11. $strSQL = "SELECT * FROM statuscheck WHERE DATE(Date) = '".$strDate."' ORDER BY Date DESC ";
  12.  
  13. $objQuery = mysql_query($strSQL);
  14. $obResult = mysql_fetch_array($objQuery);
  15. if($obResult)
  16. {
  17. $arr['StatusID'] = "0";
  18. $arr["SubjectID"] = $obResult["SubjectID"];
  19. $arr["Qr"] = $obResult["qrcode"];
  20. $arr["Sh"] = $obResult["shake"];
  21. $arr["Ba"] = $obResult["barcode"];
  22. $arr["Ch"] = $obResult["checklist"];
  23. $arr["Qi"] = $obResult["qiz"];
  24. $arr["Ph"] = $obResult["phase"];
  25. }
  26. else
  27. {
  28. $arr["SubjectID"] = "null";
  29. }
  30.  
  31. mysql_close($objConnect);
  32. echo json_encode($arr);
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement