Populate javascript array(s) from mysql

M

mike

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!
 
R

Randell D.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,141
Latest member
BlissKeto
Top