Java script and mySql

Started on the old forum in November 2010 · view the original in the archive · old links redirect here

6 replies · 475 views · started 16 years ago · 1 min read

3 participants
cwikyz Junior · 12 posts #1

Please help me! I want to set it to me javascript writes and reads data from the mySql! In real time! 4 lavalair shoutbox! Thanks in advance!

My FaceBook clone: http://secafe.freehostia.com

pmbguy Senior · 344 posts #2

i think you'll find it easier to use ajax... otherwise i don't think it's doable cause javascript runs client side n db is server side, so you'd need some kinda refresh i think, like you could do it as a j2me application, but not on a mobile site to my knowledge... I've asked around about similar stuff n a mate was explaining how to link javascript with database the other day, it's all hidden fields n posting n stuff...

cwikyz Junior · 12 posts #3

ok! I am developing for the PC, in other words we create something in the style of facebook! So I need something to refresh me that part, without refreshing the whole page! :/

My FaceBook clone: http://secafe.freehostia.com

pmbguy Senior · 344 posts #4

ok well i found this code on another site..

here if you wanna read whole topic...

<html> <body> <script type="text/javascript"> function Ajax(){ var xmlHttp; try{ xmlHttp=new XMLHttpRequest();// Firefox, Opera 8.0+, Safari } catch (e){ try{ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer } catch (e){ try{ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ alert("No AJAX!?"); return false; } } } xmlHttp.onreadystatechange=function(){ if(xmlHttp.readyState==4){ document.getElementById('ReloadThis').innerHTML=xmlHttp.responseText; setTimeout('Ajax()',10000); } } xmlHttp.open("GET","http://www.example.com/the_page_that_contains_the_div_content",true); xmlHttp.send(null); } window.onload=function(){ setTimeout('Ajax()',10000); } </script>

Default text

</body> </html>

that should work... they posted something about not on ie, but apparently it works in mozilla chrome, opera, etc...

Added after 5 minutes:

but that's a mixture of ajax n javascript... won't work on most mobiles, maybe on smartphones with all the newfangled technology...

(note to whoever: ok, according to your auto spell check, or is it my browsers? I'm using chrome btw, javascript is a spelling mistake but newfangled isn't... go figure!)

cwikyz Junior · 12 posts #5

Thanks! But this does not work! 🙁 I found some scripts that work with ajax, php and mysql! I hope to be able to do something! Thanks again! 😉

My FaceBook clone: http://secafe.freehostia.com

ramciv14 Junior · 26 posts #6

jquery can solve your problem..jquery has lot of functions including ajax.

Added after 2 minutes:

or create a flash based shoutbox..

cwikyz Junior · 12 posts #7

I know for jQuery! Junior alone in ajax and javascript! Well, I can not do bass with them, and php, mysql, html and wml know mint! And lavalair I studied a lot! That is why he reconstructs the open source community website! Of course only one version will be posted for download! 😉

My FaceBook clone: http://secafe.freehostia.com

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close