473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

show information in textbox from mysql

57
Let's say there is an A/C no. in my database and it is is 01234553434.
I want to type a/c no. into a textbox. When i type then numbers "012", the rest of digits should show up in textbox from database automatically.

I am using MySQL for a database.
Apr 13 '10 #1
3 2527
chathura86
227 100+
well it is all about AJAX and CSS

what you need to do is place the textbox and use key press event
http://www.smartwebby.com/DHTML/text...rs_counter.asp
http://www.geekpedia.com/tutorial138...avaScript.html

on the key press event send an ajax request to server with the entered value
http://www.w3schools.com/php/php_ajax_database.asp

on the server you have a php page where you get the value and search it
on the database and get the relevant values and sends back to the
browser

use js to show these data on the page the way you want.

here is a good example done with jquery

http://www.nodstrum.com/2007/09/19/autocompleter/

try it out and post your code here if you have any problems

i will try to help you


Regards
Apr 13 '10 #2
Markus
6,050 Expert 4TB
Moving this to JavaScript as it has more to do with that than PHP.
Apr 13 '10 #3
Frinavale
9,735 Expert Mod 8TB
We'll see where this ends up being placed but PHP does play a part here.

When ever the user types a character into the text box you have to make an Ajax request to the server (a PHP script) which will return any matching options based on what the user typed. When the Ajax request is finished, and the browser has received the matches, you will use JavaScript to display the options to the user.

The articles that chathura86 posted should get you pointed in the right direction.
Apr 14 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Tim Williams | last post by:
I'm trying to write a simple python program to access a MySQL database. I'm having a problem with using MySQLdb to get the results of a SQL command in a cursor. Sometimes the cursor.execute works,...
0
by: John Yasaitis | last post by:
I seem to have replication set up correctly to only replicate one database named vmail.* Except when I try to update a table in vmail.* the changes do not replicate to the slave. Authentication...
3
by: millw0rm | last post by:
I got a textbox with name = action, whn a key is press (eg. 'm') it sends a query to database grabs data from server n send data back keywords found, each keyword got a function called...
3
by: John Salerno | last post by:
Hi everyone. I just installed MySQL on my home PC and I tested out the show databases query, and it lists two: information_schema bbdatabank The second one is one I created myself, but I...
0
by: Allan Kim Jensen | last post by:
Hello, I am trying to retrieve data from a MySql database using ASP.net, and it works fine when putting the result into a gridview (Code provided in the end of this mail). However, I'd like...
4
by: Ken | last post by:
Is there any way to show current webpage in Label or textbox? for example, if the page address I browse currently is http://localhost/try/default.aspx then I want to show the information about...
2
by: Ken | last post by:
Is there any way to show current webpage in Label or textbox? for example, if the page address I browse currently is http://localhost/try/default.aspx then I want to show the information about...
1
by: judy | last post by:
I have several databases that are used to collect data for different client-projects. My intention was to collect the data, and administer mySQL so each client could see only their data. Each of...
2
by: Sudhakar | last post by:
hi I am using MySQL - 4.1.22 when i use the following sql query $result = mysql_query("SHOW tablename STATUS FROM databasename;"); i have also tried = $result = mysql_query("SHOW tablename...
3
by: janetopps | last post by:
I have a news website, with asp pages, which was on Access, and i upgraded to MySQL, i used Bullzip to transfer the data. It had about 1000 pages, which im now able to pull up on the public side. Im...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.