 |
19-07-2007, 11:50 AM
|
#1 (permalink)
|
|
In The Zone
Join Date: Jul 2005
Location: KOLKATA
Posts: 267
|
Help in PHP Mysql script
I have a table containing name and address in mysql.I have a form in php which has a textbox where the user can enter the name and clicking the button gets the corresponding address from mysql database.Now I want to modify the script so that when the user is typing the name, the corresponding list of names starting with the letter the user has typed so far should appear in the textbox as a list of alternatives from the database from where the user can choose the name without typing further(Something similar to the phonebook of our mobile phones and something which the browser automaticaly does for the textbox by showing the previous inputs from the cache.).To be more exact, the script is similar to the script running in the search->advance search->search by auther name in the digit forum.No ,I am not asking the phpbb script for the advance search but the idea to design such script. Please help.
__________________
Desktop: P-IV 2.4GHz, 512MB DDR, 865GBF Mother Board,
G-Force 5200FX, 17" Samsung flat, WinXp with SP2,
Kaspersky Internet Security 2009.
Laptop:LENOVO 3000 C100 D7 lappy with 2GB DDR2.
|
|
|
|
Advertisements. Register and be a member of the community to get rid of them.
|
|
Advertisement
|
|
19-07-2007, 12:08 PM
|
#2 (permalink)
|
|
Security freak
Join Date: Jul 2007
Location: 01100001 01110100 00100000 01101000 01101111 01101101 01100101 00100001
Posts: 227
|
Re: Help in PHP Mysql script
I would imagine that would require a decent amount of AJAX to accomplish. You could write a function in Javascript that handles retrieving the list of names from the server and call it "onChange" for your textbox. I'm not terribly versed in AJAX (my company just started really using it and I'm on the support programming team handling our previous version), so I can't be of much assistance with actual code...but AJAX should get you started in the right direction.
The same functionality might also be available in later versions of PHP (again, previous version of our software is still using PHP 4.4.x).
__________________
Linux Admin by profession. OpenBSD user by choice.
|
|
|
19-07-2007, 05:03 PM
|
#3 (permalink)
|
|
In The Zone
Join Date: Jul 2005
Location: KOLKATA
Posts: 267
|
Re: Help in PHP Mysql script
@rocket357-- Since the things are happening at the client end, javascript/other client side script has to be used and the event can be based on key press or focus. These informations are already known to me.I was mainly asking about the informations on the integration of the php, javascript and the database for the problem mentioned by me.
Quote:
|
The same functionality might also be available in later versions of PHP
|
Php is a serverside scripting and cannot be used alone to perform the mentioned task, whatever may be the updated version, it cannot violate the basic concept of serverside scripting. Anyway thanks for reply.
__________________
Desktop: P-IV 2.4GHz, 512MB DDR, 865GBF Mother Board,
G-Force 5200FX, 17" Samsung flat, WinXp with SP2,
Kaspersky Internet Security 2009.
Laptop:LENOVO 3000 C100 D7 lappy with 2GB DDR2.
|
|
|
19-07-2007, 08:02 PM
|
#4 (permalink)
|
|
Security freak
Join Date: Jul 2007
Location: 01100001 01110100 00100000 01101000 01101111 01101101 01100101 00100001
Posts: 227
|
Re: Help in PHP Mysql script
Don't ask for help then insult my intelligence when I offer assistance. When I said later PHP versions might have this functionality, I was speaking strictly in terms of the integration you asked about. I'm well aware that PHP is server-side. Sorry if I didn't make that crystal-clear.
If you're aware of Javascript client-side scripting, then what more do you need to know? Perhaps I've misunderstood the question, but it appears to me that you asked how one would go about retrieving a list of names to display for the user to choose from...please correct me if I'm wrong.
__________________
Linux Admin by profession. OpenBSD user by choice.
|
|
|
21-07-2007, 02:46 PM
|
#5 (permalink)
|
|
In The Zone
Join Date: Jul 2005
Location: KOLKATA
Posts: 267
|
Re: Help in PHP Mysql script
@rocket357-First of all I am extremely sorry if by any means I have ofended you. There was no such intention for a person who is trying to help me.I tried to explain the problem in greater detail and the doubts arised from your reply.
Sorry again if it hurted you unknowingly.
Now my main doubt was that to access the database I am using a server side scripting and on the html page, a client side scripting.I donot have any idea, if it is possible to access the database with clientside scripting.If that is possible, it will solve my problem.
__________________
Desktop: P-IV 2.4GHz, 512MB DDR, 865GBF Mother Board,
G-Force 5200FX, 17" Samsung flat, WinXp with SP2,
Kaspersky Internet Security 2009.
Laptop:LENOVO 3000 C100 D7 lappy with 2GB DDR2.
|
|
|
21-07-2007, 05:19 PM
|
#6 (permalink)
|
|
eWebGuru
Join Date: Mar 2006
Location: Dehradun
Posts: 427
|
Re: Help in PHP Mysql script
Quote:
|
Now my main doubt was that to access the database I am using a server side scripting and on the html page, a client side scripting.I donot have any idea, if it is possible to access the database with clientside scripting.If that is possible, it will solve my problem.
|
This is what AJAX is, I think.
__________________
Windows and linux hosting at http://www.ewebguru.com
Get $50 per blog post PM me for details.
|
|
|
21-07-2007, 05:29 PM
|
#7 (permalink)
|
|
Security freak
Join Date: Jul 2007
Location: 01100001 01110100 00100000 01101000 01101111 01101101 01100101 00100001
Posts: 227
|
Re: Help in PHP Mysql script
Quote:
|
Originally Posted by bukaida
@rocket357-First of all I am extremely sorry if by any means I have ofended you. There was no such intention for a person who is trying to help me.I tried to explain the problem in greater detail and the doubts arised from your reply.
Sorry again if it hurted you unknowingly.
|
Nah, I should apologise...I did take your post somewhat offensively, but my reaction was more tied to the bad day I was having at work...forgive me for snapping back. I'm usually MUCH more level headed!
Quote:
|
Originally Posted by bukaida
Now my main doubt was that to access the database I am using a server side scripting and on the html page, a client side scripting.I donot have any idea, if it is possible to access the database with clientside scripting.If that is possible, it will solve my problem.
|
I've never *personally* done this, but it's my understanding that you can code a service for your web server that the AJAX code can connect back to. The service can then perform the database lookups you require. Since you aren't going through the "normal" channels (the http service), you don't need to refresh the page and can perform realtime lookups like you're asking about.
And I bet if you google AJAX you'll find open source / free services (GWT, if you're into Java) that are ready to roll out to your server as an AJAX-compatible service. AJAX uses XML ( Asynchronous Javascript And XML), so there's quite a bit of freedom in structuring requests/responses as you need.
Good luck on the coding, and again, I apologise for my reaction in my last post.
__________________
Linux Admin by profession. OpenBSD user by choice.
|
|
|
22-07-2007, 06:57 PM
|
#8 (permalink)
|
|
Wise Old Owl
Join Date: Nov 2006
Location: Pune, Maharashtra, India
Posts: 1,728
|
Re: Help in PHP Mysql script
Try jquery
__________________
KDE on ArchLinux
PHP, MySQL, PostgreSQL, Linux, Apache; Message me to hire (freelancing only)
Explore Technology @ http://www.itech7.com
Cheap and Reliable VPS Hosting @ http://j.mp/arHk5e
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
|
Mysql Help
|
Desi-Tek.com |
Open Source |
4 |
27-11-2006 12:24 PM |
|
help in PHP-mysql
|
bukaida |
Open Source |
7 |
08-11-2006 03:20 PM |
|
MySQL - GUI / CLI
|
Trinity |
QnA (read only) |
7 |
23-07-2005 07:25 PM |
|
|
|