Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Power Lifting Lever Belt
SkullVamp
Updated:
Saturday at 10:32 PM
Ad icon
port.lk Domain for sale
Lankan-Tech
Updated:
Saturday at 3:55 PM
Colombo
Kaduwela - Two Storey House for Sale
dilrasan
Updated:
Thursday at 2:23 PM
Ad icon
Wechat qr verification
Pawan2005
Updated:
Thursday at 1:28 AM
🚀 GOOGLE AI PRO 18 MONTHS ACTIVATION 🚀
sayuru bandara
Updated:
Jun 10, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri PRO!
ElaKiri PRO Section!
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="heshan123" data-source="post: 1785862" data-attributes="member: 15457"><p>Does anyone know how to access a MySQL databse using AJAX? </p><p></p><p>[CODE]var xmlHttp</p><p></p><p>function showUser(str)</p><p>{ </p><p>xmlHttp=GetXmlHttpObject()</p><p>if (xmlHttp==null)</p><p> {</p><p> alert ("Browser does not support HTTP Request")</p><p> return</p><p> }</p><p>var url="getuser.php"</p><p>url=url+"?q="+str</p><p>url=url+"&sid="+Math.random()</p><p>xmlHttp.onreadystatechange=stateChanged </p><p>xmlHttp.open("GET",url,true)</p><p>xmlHttp.send(null)</p><p>}</p><p></p><p>function stateChanged() </p><p>{ </p><p>if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")</p><p> { </p><p> document.getElementById("txtHint").innerHTML=xmlHttp.responseText </p><p> } </p><p>}</p><p></p><p>function GetXmlHttpObject()</p><p>{</p><p>var xmlHttp=null;</p><p>try</p><p> {</p><p> // Firefox, Opera 8.0+, Safari</p><p> xmlHttp=new XMLHttpRequest();</p><p> }</p><p>catch (e)</p><p> {</p><p> //Internet Explorer</p><p> try</p><p> {</p><p> xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");</p><p> }</p><p> catch (e)</p><p> {</p><p> xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");</p><p> }</p><p> }</p><p>return xmlHttp;</p><p>}[/CODE]</p><p></p><p>The above code is used to access the MySQL database using a file called "getuser.php". But what I want is direct access. Does anyone know how to do it?</p></blockquote><p></p>
[QUOTE="heshan123, post: 1785862, member: 15457"] Does anyone know how to access a MySQL databse using AJAX? [CODE]var xmlHttp function showUser(str) { xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="getuser.php" url=url+"?q="+str url=url+"&sid="+Math.random() xmlHttp.onreadystatechange=stateChanged xmlHttp.open("GET",url,true) xmlHttp.send(null) } function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("txtHint").innerHTML=xmlHttp.responseText } } function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { //Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; }[/CODE] The above code is used to access the MySQL database using a file called "getuser.php". But what I want is direct access. Does anyone know how to do it? [/QUOTE]
Insert quotes…
Verification
Asuwa dahayen wadi kalama keeyada?
Post reply
Top
Bottom