JSHINER Posted October 19, 2007 Share Posted October 19, 2007 I am trying to make a page query a database for an ajax auto complete. The sample code they gave was: (I am using the script.aculo.us libraries.) <cfparam name="form.email" default="" type="string"> <cfquery datasource="dsn" name="suggestions"> SELECT email FROM contacts WHERE email LIKE </cfquery> <ol> <cfoutput query="suggestions"> <li>#suggestions.email#</li> </cfoutput> </ol> But I want to do the above in PHP. Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/73970-i-need-help-with-a-query/ Share on other sites More sharing options...
gerkintrigg Posted October 19, 2007 Share Posted October 19, 2007 Isn't this supposed to be PHP? - Forgive me, but I know Scrubbly noggin about Ajax. Quote Link to comment https://forums.phpfreaks.com/topic/73970-i-need-help-with-a-query/#findComment-373326 Share on other sites More sharing options...
JSHINER Posted October 19, 2007 Author Share Posted October 19, 2007 I just need a file that will do the above that CF is doing but in PHP. Quote Link to comment https://forums.phpfreaks.com/topic/73970-i-need-help-with-a-query/#findComment-373328 Share on other sites More sharing options...
pocobueno1388 Posted October 19, 2007 Share Posted October 19, 2007 Do you know exactly what that part of the script is doing? To me, it looks like they are just selecting information from the database, and possibly displaying it? Quote Link to comment https://forums.phpfreaks.com/topic/73970-i-need-help-with-a-query/#findComment-373336 Share on other sites More sharing options...
JSHINER Posted October 19, 2007 Author Share Posted October 19, 2007 It appears that way. I know each time a letter is typed into a form field it re-queries the database to return new results. Quote Link to comment https://forums.phpfreaks.com/topic/73970-i-need-help-with-a-query/#findComment-373337 Share on other sites More sharing options...
pocobueno1388 Posted October 19, 2007 Share Posted October 19, 2007 I know each time a letter is typed into a form field it re-queries the database to return new results. Well, you can't really do that without AJAX. I'm not sure if thats what your looking to do though. If you want to just use PHP to display that information, just select the info from the db, and use a while loop to display them. Is that what your needing help with? Quote Link to comment https://forums.phpfreaks.com/topic/73970-i-need-help-with-a-query/#findComment-373348 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.