<?php

$q = strtolower( $_GET["q"] );
if (!$q) return;

$dbhost = "localhost";		// Database Host
$dbuser = "peter";			// User
$dbpass = "i4mt3rr0r";			// Password
$dbname = "Cody";			// Name of Database

mysql_connect( $dbhost, $dbuser, $dbpass ) or die( mysql_error() );
mysql_select_db( $dbname ) or die( mysql_error() );

// Replace "TABLE_NAME" below with the table you'd like to extract data from
$data = mysql_query( "SELECT * FROM employees" )
or die( mysql_error() );

// Replace "COLUMN_ONE" below with the column you'd like to search through
// In between the if/then statement, you may present a string of text
// you'd like to appear in the textbox.
while( $row = mysql_fetch_array( $data )){
	if ( strpos( strtolower( $row['empFName'] ), $q ) !== false ) {
		echo $row['empFName'] . " " . $row['empLName'] . "\n";
	}
}

?>