Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set('display_errors',1);
- ini_set('display_startup_errors',1);
- error_reporting(-1);
- include_once('includes/connect.php');
- $q = $db->prepare("SELECT COUNT(id) as records FROM tracker WHERE que_id = 3");
- $q->execute();
- $records = (int) $q->fetch(PDO::FETCH_OBJ)->records;
- echo '$records =', $records;
- $query = $db->query("SELECT `id`, `votNumber`, `first_last`, `phone`, `city`, `active`, `gender`, `birth_year`, `registration_date` FROM `members` WHERE `id` = $records");
- while($rows = $query->fetch(PDO::FETCH_ASSOC)){
- echo $rows['id'] . '<br/>';
- echo $rows['votNumber'].'<br/>';
- echo $rows['first_last'].'<br/>';
- echo $rows['phone'].'<br/>';
- echo $rows['city'] . '<br/>';
- echo $rows['active'].'<br/>';
- echo $rows['gender'].'<br/>';
- echo $rows['birth_year'].'<br/>';
- echo $rows['registration_date'].'<br/>';
- }
- ?>
- operation.php
- ?php
- session_start();
- ini_set('display_errors',1);
- ini_set('display_startup_errors',1);
- error_reporting(-1);
- include_once ('connect.php');
- if(isset($_POST['call'])){
- $c = preg_replace('#[^a-z ]#i', '', $_POST['call']);
- echo $c;
- // do stuff for no answer or contacted
- $q = $db->prepare("SELECT COUNT(id) as records FROM tracker WHERE que_id = 3");
- $q->execute();
- $records = (int) $q->fetch(PDO::FETCH_OBJ)->records;
- echo '$records =', $records;
- $stmt = $db->prepare("UPDATE tracker SET id = :value ");
- $stmt->bindParam(':value', $id);
- // insert one row
- $id++;
- $stmt->execute();
- //$que_id = mysql_insert_id();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement