PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE TABLE City ( Name VARCHAR(64), District VARCHAR(64) ); INSERT INTO City VALUES ('Aachen', 'Nordrhein-Westfalen'), ('Augsburg', 'Baijeri'), ('Bergisch Gladbach', 'Nordrhein-Westfalen'), ('Berlin', 'Berliini'), ('Bielefeld', 'Nordrhein-Westfalen');
Copy Clear
Copy Format Clear
<?php $query = 'SELECT Name FROM City WHERE District=? ORDER BY Name LIMIT 5'; $result = $mysqli->execute_query($query, ['Nordrhein-Westfalen']); echo mysqli_num_rows($result); foreach ($result as $row) { printf("%s \n", $row["Name"]); }
Show:  
Copy Clear