[Proto-Scripty] Re: help with autocompleter

2009-01-30 Thread Lars Schwarz
ft_min_word_len is a mysql config parameter, no need for it as long you don't want so use mysql's fulltext search On Fri, Jan 30, 2009 at 7:12 PM, eulerss wrote: > > thanks a lot, disccomp and lars, i didnt' know this > > $safe_id = mysql_real_escape_string($_REQUEST['id']); > > lars you said th

[Proto-Scripty] Re: help with autocompleter

2009-01-30 Thread eulerss
thanks a lot, disccomp and lars, i didnt' know this $safe_id = mysql_real_escape_string($_REQUEST['id']); lars you said that when you want to use fulltext search keep in mind there's a ft_min_word_len config variable which defaults to 4 characters (so won't get any results when searching with 2

[Proto-Scripty] Re: help with autocompleter

2009-01-30 Thread Lars Schwarz
if you specified paramName: "value" on the autocompleter call then on php side your variable will be $_POST['value']. simple pattern search would then work like: $searchTerm = mysql_real_escape_string($_POST['value']) . "%"; // add a wildcard and your query for example might look like "select *

[Proto-Scripty] Re: help with autocompleter

2009-01-30 Thread disccomp
> and i need to get this value, like this $searchterm=$_REQUEST['id'];?? You should make it injections safe, for example if using PHP: $safe_id = mysql_real_escape_string($_REQUEST['id']); $query = "SELECT last_name, first_name FROM people WHERE last_name='$safe_id' "; Checkout http://us.php.ne

[Proto-Scripty] Re: help with autocompleter

2009-01-29 Thread eulerss
hi Lars, for example if i want pulling data from a database, you said that something like this: > or when pulling data from a database using something like WHERE field > LIKE '$searchterm' $searchterm is what i type un the input?? and i need to get this value, like this $searchterm=$_REQUEST['id

[Proto-Scripty] Re: help with autocompleter

2009-01-29 Thread Lars Schwarz
you need to filter your result list (which was static in your last post) of course... something like: function autocomplete($needle,$haystack) { $html = ''; foreach($haystack as $straw) { if($needle != '' && stristr($straw, $needle)) { $html .= ''.$straw.'';

[Proto-Scripty] Re: help with autocompleter

2009-01-29 Thread eulerss
i was checking my example and i think that it doesn't work propertly, for instance, if i type "p" all options appears, like alve alvr .. per par por ... zer zae and must appear the options that start with "p", isn't it? here is my code

[Proto-Scripty] Re: help with autocompleter

2009-01-29 Thread eulerss
thanks a lot for you replay "disccomp", now it works, i think that i was correct, because i only change the libraries for that one that you put in the replay,my doubt is that in the past i was usig this libraries in order to implement dependent selects and it works perfectly, now i need to check

[Proto-Scripty] Re: help with autocompleter

2009-01-29 Thread disccomp
Try including these instead: http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/ prototype.js" type="text/javascript"> http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.1/ scriptaculous.js" type="text/javascript"> --~--~-~--~~~---~--~~ You receive

[Proto-Scripty] Re: help with autocompleter

2009-01-28 Thread eulerss
here is my code Event.Observe(window,'load', function(){ new Ajax.Autocompleter("autocomplete", "autocomplete_choices", "./ li.php"); } ) and my error is: 'Event' is undefined if a change my code for this new Event.Observe(window,'load', .

[Proto-Scripty] Re: help with autocompleter

2009-01-28 Thread disccomp
Just a guess. Maybe try waiting for the DOM to load before calling your function: new Ajax.Autocompleter("autocomplete", "autocomplete_choices", "./ li.php", {}); Like this: Event.Observe(window,'load',function(){ new Ajax.Autocompleter("autocomplete", "autocomplete_choices", "./ li.php", {});

[Proto-Scripty] Re: help with autocompleter

2009-01-27 Thread eulerss
is there any body out there? :( On 23 ene, 10:34, eulerss wrote: > i have a problem :( this is my error: > > "Stack overflow at line 1926" > > this error appears when i load for fist time the page,for example, if > i type "P", appears, but then, not any more, and the most important > thing is th

[Proto-Scripty] Re: help with autocompleter

2009-01-23 Thread eulerss
i have a problem :( this is my error: "Stack overflow at line 1926" this error appears when i load for fist time the page,for example, if i type "P", appears, but then, not any more, and the most important thing is that my autocomplete function is not working, here is my simple code that i take

[Proto-Scripty] Re: help with autocompleter

2009-01-23 Thread eulerss
Thanks Colin, i'm reading the link, if i continue with problems, i'll post here eulerss On 23 ene, 04:34, ColinFine wrote: > On Jan 22, 11:18 pm, eulerss wrote:> please help, i > was seeing one example but i have some doubts > > > 1) in the principal file > > > > > > > > > > its necessary

[Proto-Scripty] Re: help with autocompleter

2009-01-23 Thread ColinFine
On Jan 22, 11:18 pm, eulerss wrote: > please help, i was seeing one example but i have some doubts > > 1) in the principal file > > > > > > its necessary to add the unittest.js?? (sorry i repeated, im noob in > this) > No. I've never included it. > 2) if i used, for instance response.php in

[Proto-Scripty] Re: help with autocompleter

2009-01-22 Thread eulerss
please help, i was seeing one example but i have some doubts 1) in the principal file its necessary to add the unittest.js?? (sorry i repeated, im noob in this) 2) if i used, for instance response.php in order to get all values, whats the correct form? i mean, can i used response.php simple

[Proto-Scripty] Re: help with autocompleter

2009-01-22 Thread eulerss
yep, its not var as var, actually the name is different to var, i only use var as an example, alex can u help me with the autocompleter?, some ideas or one example, i was looking for a similar post with autocomplete function, but i dont understand to much, i need some for newies, thanks in advance

[Proto-Scripty] Re: help with autocompleter

2009-01-21 Thread Alex Mcauley
for a start i wouldnt use var as a var in this line var = transport.responseText; ... try var foo=transport.responseText; instead - Original Message - From: "eulerss" To: "Prototype & script.aculo.us" Sent: Wednesday, January 21, 2009 6:31 PM Subject: [Proto-Scripty] help with a