Skip to content

Instantly share code, notes, and snippets.

@s4wny
s4wny / backend.php
Last active November 18, 2015 17:37
ajax autocomplete tutorial
<?php
$mysqli = new mysqli('localhost', 'test', 'test', 'test');
if($mysqli->connect_errno)
exit("Connect failed: %s\n". $mysqli->connect_error);
$stmt = $mysqli->prepare("SELECT name FROM states WHERE name LIKE ?");
if($stmt) {