Jump to content

I need help with a Query


JSHINER

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/73970-i-need-help-with-a-query/
Share on other sites

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.