Hi
I am doing a scroll bar with javascript and info pulled from MySQL.
So I execute query and create an array with php called messages. Then
when my page is loaded I guess this array should be available to
JavaScript under the same name except the $. Am I right here or not?
The java script error is : messages not defined
the code is:
<html>
<body>
<table>
<tr><td>Scroll Text</td></tr>
<tr><td>
<script language='JavaScript1.2'>
<?php
include("mydbconnection.php3");
if(gettype($messages) != "array")
{ $messages = array(); }
$query="select * from text";
$results=mysql_query($query);
while($result = mysql_fetch_array($results)) {
$texttitle=$result['title'];
$body=$result['body'];
$mytext=$texttitle;
$mytext=$body;
array_push($messages, $mytext);
}
reset($messages);
?>
if(messages.length>1) {
id=1
}
...........................
</script>
</td></tr></table>
</body>
</html>
Regards
Ajdin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]