Page 1 of 1

Scrolling text using MySql data

Posted: Tue Jul 22, 2003 1:10 pm
by sharky92663
Hello,

I'm trying to implement a scrolling text area that pulls the text from a MySql database. There are plenty of javascript modules that performs the function with a pre-defined array; however, I need the text to be dynamic. If anyone has such a script or could provide some insight, I'd love to hear from you. Thanks.

Jim

...

Posted: Tue Jul 22, 2003 1:13 pm
by kettle_drum
Just use a javascript one that you can find and then set the javascript array of text using php.

Like:

$javascript_array = "<?php echo $variables_from_database?>";

not sure

Posted: Tue Jul 22, 2003 1:37 pm
by sharky92663
Thanks for your reply. I've tried something like this and the php code embedded within the <script> tags don't seem to work. I also need to implement a loop so that all the records from a table are written to the array.

...

Posted: Tue Jul 22, 2003 2:00 pm
by kettle_drum
Well the php code will be parsed server side and the javascripts runs client side, so by the time the code reaches the user the php code in the javascript should have been parsed to leave the text you want to show :)