PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
-- create CREATE TABLE EMPLOYEE ( empId INTEGER PRIMARY KEY, name TEXT NOT NULL, dept TEXT NOT NULL ); -- insert INSERT INTO EMPLOYEE VALUES (0001, 'Clark', 'Sales'); INSERT INTO EMPLOYEE VALUES (0002, 'Dave', 'Accounting'); INSERT INTO EMPLOYEE VALUES (0003, 'Ava', 'Sales'); -- fetch SELECT * FROM EMPLOYEE WHERE dept = 'Sales';
Copy Clear
Copy Format Clear
<?php /* Select queries return a resultset */ $result = $mysqli_query("SELECT Name FROM Employee"); printf("Select returned %d rows.\n", mysqli_num_rows($result)); ?>
Show:  
Copy Clear