1
Vote

does not filter the results

description

hello,

i got the flexbox to show the data from mysql. when I start to type it shows all results and it does not filter them. what am I doing wrong. here is my php and jquery codes (the php returns the correct format results)

$("#suggest").flexbox('php/source.php', {
                width: 350,
                method: 'post',
                watermark: 'Enter value',
                noResultsText: 'No Value',
                maxVisibleRows: 20,
                containerClass: 'ffb',
                contentClass: 'content',
                inputClass: 'ffb-input',
                arrowClass: 'ffb-arrow'
                  });

<?php

$mysql_server = 'localhost';
$mysql_login = 'mp';
$mysql_password = 'mp';
$mysql_database = 'material_prices';

// connect to the database server and select the appropriate database for use
$dblink = mysql_connect($mysql_server, $mysql_login, $mysql_password) or die( mysql_error() );
mysql_select_db($mysql_database);

// query the database table for zip codes that match 'term'
$rs = mysql_query('SELECT * from materials s INNER JOIN categories c ON s.vend_id = c.cid WHERE array LIKE "%'. mysql_real_escape_string($_REQUEST['term']) .'%" ORDER BY cat_name', $dblink);


$data = array();
if ( $rs && mysql_num_rows($rs) )
{
while( $row = mysql_fetch_array($rs, MYSQL_ASSOC) )
{
    $data[] = array(
        'id' => $row['id'],
        'name' => $row['label'],
    );
}

$output ['results'] = $data;
}

// jQuery wants JSON data
echo json_encode($output);
flush();

any ideas?

comments

flatscher wrote Sep 17, 2014 at 5:09 PM

Do you have a Solution found - i have the same Problem :(