473,320 Members | 1,872 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,320 software developers and data experts.

Populate javascript array(s) from mysql

I'm fairly green with javascript, and have been looking everywhere for
an example of how to load data from a mysql db into javascript arrays.

For a little background on what I'm trying to do, any suggestions would
be greatly appreciated... I have a table in a mysql db that data for
banners, each record includes the image name of the banner and the url.
I need to randomly display the banners in that table, auto refreshing
every 5-10 secs (the reason I was going to use javascript for this) on
a page.

I've already looked at
http://devshed.spunge.org/Server_Side/MySQL/JS_Arrays/ with not much
luck, about the only place I could find info on loading mysql data into
a javascript array(s).

Any suggestions or examples would be greatly appreciated!

Thanks!

Jul 23 '05 #1
1 2928
mi**@liqua.com wrote:
I'm fairly green with javascript, and have been looking everywhere for
an example of how to load data from a mysql db into javascript arrays.

For a little background on what I'm trying to do, any suggestions would
be greatly appreciated... I have a table in a mysql db that data for
banners, each record includes the image name of the banner and the url.
I need to randomly display the banners in that table, auto refreshing
every 5-10 secs (the reason I was going to use javascript for this) on
a page.

I've already looked at
http://devshed.spunge.org/Server_Side/MySQL/JS_Arrays/ with not much
luck, about the only place I could find info on loading mysql data into
a javascript array(s).

Any suggestions or examples would be greatly appreciated!

Thanks!


You won't be able to use client side javascript to populate data from a
database - Are you using server based javascript? I believe it exists,
but I've never seen/used it.

If I were you, I'd use PHP to create the javascript array... others
would suggest other server side languages, like Perl...

But MySQL (or any database for that matter) and javascript just won't
dance on their own...

randelld
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Greg Scharlemann | last post by:
I am attempting to populate a drop down menu based on the selection of a different drop down menu. However, it is not working correctly, I cannot figure out for the life of me what exactly happens...
1
by: Greg Scharlemann | last post by:
I would like to automatically populate a drop down menu when the page loads based on the selection of an item in a different drop down menu. I made a test page that when drop down #1 changes, drop...
3
by: Nath | last post by:
Please help!? I am new to writing html, javascript, pretty new to MySQL but quite proficient at writing Perl and i'm a quick learner. I am building a database driven website and i am a little...
2
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at...
4
by: Japhy | last post by:
Hello, I'm am pulling data from a mysql db and want to use the data to populate a <ul. Here are relavent parts of my code : $wohdate = mysql_result($wohRS,$wohndx,woh_date); $woh_display...
1
by: TPK | last post by:
Here is what I want to do with javascript. On a page with text place a javascript link that: 1) When a user clicks the link (onClick) a new browser window opens (the easy part) NewWindow =...
1
by: vj | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file? I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
8
by: freelance71 | last post by:
I have a combo box (select) and when the user selects a value I want to populate an HTML table from DB depending on the value selected. Whats the easiest way to achieve it. I've searched google and...
1
by: DavidPr | last post by:
I have a website that requires a visitor to register in order to make a post. I have one or two users that are violating the terms and every day I'm having to delete them. They just re-register,...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.