<?php
////////////////////////////////////////////////
//
error_reporting(E_ALL ^ E_NOTICE);
require_once ('../include/ISS_consts.inc');
require_once ('../include/connect_to_db.inc');
require_once ('../include/utils.inc');
$query = "SELECT `first_name`, `last_name`, `mi`, `primary_phone` , `id`,`COUNT(*)` `FROM` `member_tbl` WHERE status = `ACTIVE` AND `primary_phone` <> `(000) 000-0000` GROUP BY first_name, last_name, primary_phone HAVING COUNT(*) > 1";
try
{
$stmt = $pdo->prepare($query);
$stmt->execute();
$stmt = null;
}
catch(PDOException $e)
{
echo "ERROR: ".$e->getMessage()."\n".$query."\n";
}
echo "This is the data".$query."\n";
?>
I have recently been learning php and I am trying to get data a query from MySQL but I keep getting a syntax error. I know I have one but I just don't know where and how many due to all the keywords I'm not sure of. I am also trying to figure out how to output the data or will the catch and try methods output it themselves, that is why I have an echo statement calling the query at the end.