<?php
session_start();

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

include("config.inc.php");

$connection = mysql_connect($config['dbServer'],$config['dbUser'],$config['dbPass']);
		mysql_select_db($_SESSION['dbName'],$connection);

//require_once("../includes/connect.php");

// Replace "TABLE_NAME" below with the table you'd like to extract data from
$data = mysql_query( "select * from clients" )
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.
//echo $data;
echo $q."\n";
echo "test";
while( $row = mysql_fetch_array( $data )){
	
	extract($row);
	echo strpos( strtolower( $ledger_number ), $q )."\n";
	if ( strpos( strtolower( $ledger_number ), $q ) !== false ) {
		echo $ledger_number."\n";
		echo $q."\n";
	}
	
	//echo $row['ledger_number']."\n";
}

?>
