Advertisement
Guest User

Untitled

a guest
Oct 7th, 2013
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. <?php
  2.  
  3. ini_set('display_errors',1);
  4. ini_set('display_startup_errors',1);
  5. error_reporting(-1);
  6. include_once('includes/connect.php');
  7.  
  8. $q = $db->prepare("SELECT COUNT(id) as records FROM tracker WHERE que_id = 3");
  9. $q->execute();
  10. $records = (int) $q->fetch(PDO::FETCH_OBJ)->records;
  11. echo '$records =', $records;
  12. $query = $db->query("SELECT `id`, `votNumber`, `first_last`, `phone`, `city`, `active`, `gender`, `birth_year`, `registration_date` FROM `members` WHERE `id` = $records");
  13.  
  14.  
  15. while($rows = $query->fetch(PDO::FETCH_ASSOC)){
  16.  
  17. echo $rows['id'] . '<br/>';
  18. echo $rows['votNumber'].'<br/>';
  19. echo $rows['first_last'].'<br/>';
  20. echo $rows['phone'].'<br/>';
  21. echo $rows['city'] . '<br/>';
  22. echo $rows['active'].'<br/>';
  23. echo $rows['gender'].'<br/>';
  24. echo $rows['birth_year'].'<br/>';
  25. echo $rows['registration_date'].'<br/>';
  26.  
  27. }
  28. ?>
  29.  
  30. operation.php
  31.  
  32. ?php
  33. session_start();
  34. ini_set('display_errors',1);
  35. ini_set('display_startup_errors',1);
  36. error_reporting(-1);
  37.  
  38. include_once ('connect.php');
  39. if(isset($_POST['call'])){
  40. $c = preg_replace('#[^a-z ]#i', '', $_POST['call']);
  41. echo $c;
  42.  
  43. // do stuff for no answer or contacted
  44. $q = $db->prepare("SELECT COUNT(id) as records FROM tracker WHERE que_id = 3");
  45. $q->execute();
  46. $records = (int) $q->fetch(PDO::FETCH_OBJ)->records;
  47. echo '$records =', $records;
  48. $stmt = $db->prepare("UPDATE tracker SET id = :value ");
  49. $stmt->bindParam(':value', $id);
  50.  
  51. // insert one row
  52. $id++;
  53.  
  54. $stmt->execute();
  55. //$que_id = mysql_insert_id();
  56.  
  57.  
  58.  
  59. }
  60.  
  61.  
  62.  
  63. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement