Location: PHPKode > scripts > StandAloneArcade - Free Arcade Script > StandAloneArcade/upload_1.4/include/autocomplete-user.php
<?php

define('SAA_ON', TRUE);
// db info
include_once('config.php');
include('./setup/setup_db.php');
// include classes
require('./classes/class_application.php');
require('./classes/class_admin.php');
require('./classes/class_user.php');
require('./classes/class_language.php');
require('./classes/class_cache.php');
require('./classes/class_category.php');
require('./classes/class_file.php');

define('IS_AJAX', TRUE);

if( !isset($_GET["term"]) )
{
	echo json_encode(array(''=>''));
	return;
}

$aReturn = array();
$sSearch = mysql_real_escape_string($_GET['term']);
	
$result = mysql_query("SELECT `id`, `user` FROM `arcade_users` WHERE `user` LIKE '{$sSearch}%' ORDER BY `user` LIMIT 12");
while ( $aRow = mysql_fetch_assoc($result) )
	$aReturn[] = array('id' => $aRow['id'], 'label' => $aRow['user'], 'value'=> $aRow['user']);
echo json_encode($aReturn);
?>
Return current item: StandAloneArcade - Free Arcade Script