Learn a bit of PHP, #phpBites
A simple connection to mysql database, and selecting from a table.
$connection = new \PDO('mysql:host='.$yourDbHost.';dbname='.$yourDbName, $yourDbUserName, $yourDbPassword);
$query = "SELECT col1, col2, col3, col4 FROM table WHERE col1 = :col1Value";
$stmt = $connection->prepare($query);
$stmt->execute([
':col1Value' => $contact_id,
]);
$result = $stmt->fetch();
Leave a Reply