i have this function that shows an autosuggest in a form:
function searchbyId($params) {
$input = strtolower($params[\'input\']);
$len = strlen($input);
I feel like this is decidedly simple, but you have a syntax error in your concat statement; you're using single quotes to escape strings but the PHP string is defined with single quotes:
$sql='SELECT DISTINCT nIdentidad, CONCAT(primerNombre, ' ', segundoNombre, ' ', primerApellido, ' ', segundoApellido) AS nombre FROM tarjeta_indent WHERE nIdentidad LIKE \''.$input.'%\' ORDER BY nIdentidad LIMIT '.$limit;
How about this?
$sql = sprintf(<<
If I'm right about db_query
and you're using Drupal, try this instead (for Drupal 7):
$sql = << $input, ':limit' => $limit));
This would be the Drupal 6 version:
$sql = <<