AutoPulse v 1.0.1
 
Loading...
Searching...
No Matches
C:/Users/ivans/OneDrive/Документы/ZWA/sem/get_makes.php File Reference

This script retrieves the unqiue values of the 'make' column of the 'models' table and sends them as .json response. More...

Variables

if(isset($error) && $error==="db_access_failed") try
 
 $makes = []
 
 while ( $row=$stmt->fetch(PDO::FETCH_ASSOC))
 

Detailed Description

This script retrieves the unqiue values of the 'make' column of the 'models' table and sends them as .json response.

Variable Documentation

◆ $makes

$makes = []

◆ try

if (isset( $error) &&$error==="db_access_failed") try
Initial value:
{
$stmt = $pdo->query('SELECT DISTINCT make FROM models')
if(! $user) catch(PDOException $e) $pdo
Definition myprofile.php:59
if(! $userExists) $stmt
Definition process-accountDelete.php:48

Checks for a database access error and terminates the script if it occurs.

◆ while

while($row=$stmt->fetch(PDO::FETCH_ASSOC)) ( $row = $stmt->fetch(PDO::FETCH_ASSOC))

Loops through the query results and collects distinct makes into an array. Encodes the collected makes as a JSON array and outputs it.