JavaScript - How do I pull rows from mysql with Javascript onchange function

Asked By Olusegun A. on 20-Nov-12 10:27 AM
Hello there,

I have a website where info of registered member from various countries and states are collected. On my search form, I have 3 fields; Country, State and Sex. I listed all the countries of the world in my search (as a dropdown), but the state field is empty. Want i want is that once a visitor select a country, i want only the states of that country which registered members have are in my database to be pulled into the state field, instead of all the state of that country.

Eg 3 members from USA are from New York, New Jersey and Georgia. On selecting USA in the country dropdown, only these 3 state should appear under the state insteadt of the 50 states in america.
Pls help.

Thanks
adsegzy
Robbe Morris replied to Olusegun A. on 20-Nov-12 11:22 AM
You will have to set up a server side http handler to accept requests from JavaScript.  JavaScript cannot access MySql (or any other server side database) directly.  So, you'd have a server side page (asp.net or php I guess) that would connect to the database and return html/json to your JavaScript call over XmlHttpRequest.
Olusegun A. replied to Robbe Morris on 21-Nov-12 05:14 AM

Thanks Robbe,

I know how to setup php to pull out data from the database, but my problem it how toreturn html/json to your JavaScript call over XmlHttpRequest. Pls do you have

Thanks

help
Connection Dim MyRecordset As New ADODB.Recordset MyRecordset.ActiveConnection = cnn 'Build the SQL statement Dim MySQL As String MySQL = "SELECT Representatives.CID, " MySQL = MySQL & " Representatives.NIC, " MySQL = MySQL & " Representatives.[Last Name], " MySQL = MySQL & " Representatives.[First Name], " MySQL = MySQL & " [First Name] & ' ' & [Last Name] AS " MySQL = MySQL & " [Full Name], Positions
i have this sql in a web page: mySQL = "INSERT INTO precos (ano, nm_mes, n_semana, cod_casa, inicio, fim, preco)" mysql = mysql & " values (" & datepart("yyyy", dt_inic) & ", " mysql = mysql & datepart("m", dt_inic) & ", " mysql = mysql & n_semana & ", " mysql = mysql & request("cod_casa") & ", convert(datetime, '" mysql = mysql & request.form("inicio") & "'), convert(datetime, '" mysql = mysql & request
MySQL database server was born out of an internal company project spearheaded by employees of the Sweden-based TcXDataKonsult firm. Their project, dubbed MySQL, was first released to the general public at the end of 1996. The software proved so popular that in 2001 they founded a company based entirely around MySQL specific service and product offerings, calling it MySQL AB. MySQL is a relational database server that inches closer to the SQL-92 standard with each t encounter too many surprises if you're familiar with another database product. What is MySQL? ( 331 Views ) keywords: MySQL description: MySQL database server was born out of an internal company
error (comma) in query expression '( Asset_Info.AssetID , 'SYSADDEQ' , 'SYSTEM' , 'SYSTEM' , #03 / 03 / 2008 12:4200#) ' mySQL = "INSERT INTO wf_history (permanent_id, wf_use, input_by, sponsor, act_date) " mySQL = mySQL + " SELECT( Asset_Info.AssetID , 'SYSADDEQ' , 'SYSTEM' , 'SYSTEM' , " & Format(actDate, " \ #mm / dd / yyyy hh:mm:ss \ #") & " )" mySQL = mySQL + " FROM Asset_Info " mySQL = mySQL + " LEFT JOIN Assets ON Asset_Info.AssetID = Assets. Permanent_id mySQL = mySQL + " WHERE Assets.Permanent_id Is Null " mySQL = mySQL + " AND Asset_Info.AssetClass = 'equity' " myDB.Execute mySQL
i am fresher in MYSQL. so mysql for all details first to last . simple examples Hi, To learn mysql you can make use of the following links: http: / / www.tizag.com / mysqlTutorial http: / / dev.mysql.com / doc / refman / 5.0 / en / tutorial.html you can check here for step by step learning including installation of the mysql http: / / www.learn-mysql-tutorial.com / show here useful link for MySQL Tutorials http: / / www.tutorialspoint.com / mysql / index
This explains the different Datatypes available in MySQL. MySQL Datatypes are broadly classified into three categories namely: 1) N umeric Datatypes These include Int to the time and timezone info alongwith daylightsavings time where applicable select particular database of MySql from PHP This explains how to select particular Database from mysql databases from PHP. Connect to MySql from PHP This explains how to connect to MySql from PHP Set root password for mysql Database This explains how to set root password
if any one knows please tell hi, Here Is Command Line For silent installation of Mysql server 5.0 Step 1. Install mysql-essential-5.0 Following Command To install that . start mysql-essential-5.0.45-win32.msi / quiet / norestart Step 2. Set configuration Run Following Command line For That . cd \ cd Program Files cd MySQL cd MySQL Server 5.0 cd bin MySQLInstanceConfig.exe -i -q "-lC: \ mysql_install_log.txt" "-nMySQL Server 5.0" "-pC: \ Program Files \ MySQL \ MySQL Server 5.0" -v5.0.45 "-tC: \ Program Files \ MySQL \ MySQL Server 5.0
hi friends I need default connection string in mysql please help me Thank You Local MySQL database using MySQL ODBC 3.51 Driver: ConnectionString = "DRIVER = {MySQL ODBC 3.51 Driver}; SERVER = localhost;" &_ "DATABASE = your_mysql_database; UID = your_username; PASSWORD = your_password; OPTION = 3 Remote MySQL database using MySQL ODBC 3.51 Driver: ConnectionString = "DRIVER = {MySQL ODBC 3.51 Driver}; SERVER = data.domain.com
I am facing real problem in creating procedure in MYSQL my versoin of mysql is mysql 5.0.45 and for interface tools i m using SQLyog i need to create and no procedure is been created . i took help from the following web pages dev.mysql.com kbedell.com forums.mysql.com Can anyone help me for solving this problem CREATE PROCEDURE update_testlink () BEGIN DECLARE id1 loop LOOP1; 37 end BLOCK1; Follow this link- http: / / rpbouman.blogspot.com / 2005 / 10 / nesting-mysql-cursor-loops.html thanks james & vickey F but i m getting an error No query