PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
-- create a table CREATE TABLE students ( id INTEGER PRIMARY KEY, name TEXT NOT NULL, gender TEXT NOT NULL ); -- insert some values INSERT INTO students VALUES (1, 'Ryan', 'M'); INSERT INTO students VALUES (2, 'Joanna', 'F'); -- fetch some values SELECT * FROM students WHERE gender = 'F';
Copy Clear
Copy Format Clear
<?php $res = mysqli_query($mysqli, "SELECT * FROM students WHERE gender = 'F'"); $res = mysqli_fetch_array($res); echo $res; ?>
Show:  
Copy Clear