PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE TABLE admin ( id int auto_increment primary key, username varchar(64), password varchar(64) ); INSERT INTO admin (username, password) VALUES ('user1', 'user1_password');
Copy Clear
Copy Format Clear
<?php $conn = &$mysqli; $_POST['username'] = 'user1'; $username = mysqli_real_escape_string($conn, $_POST['username']); $query = "SELECT * FROM `admin` WHERE `username`='$username'"; $result = mysqli_query($mysqli, $query); $row = mysqli_fetch_assoc($result); // Results No Data print_r($row);
Show:  
Copy Clear