RE: [PHP] Menu populated based on previous menu
| From: | Pablo Gosse | Date: | Tue, 28 Oct 2003 17:52:02 +0000 |
| Subject: | RE: [PHP] Menu populated based on previous menu | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-167901@lists.php.net to get a copy of this message | ||
Hi Robb. This is exactly what you'll need to do.
Something like the following, assuming you're populating an array with
user information:
<script type="text/javascript">
<!--
var users = new Array();
<?php
$count = 0;
while (!$users->EOF))
{
echo 'users['.$count.'] = '.$users->fields['username'].chr(10);
$count++;
$users->MoveNext();
}
?>
//-->
</script>
The users array will now be populated with the usernames returned from
your query.
Cheers,
Pablo
-----Original Message-----
From: Robb Kerr [mailto:rkerr@digitaliguana.com]
Sent: Tuesday, October 28, 2003 9:48 AM
To: php-general@lists.php.net
Subject: Re: [PHP] Menu populated based on previous menu
I've found some JavaScripts that will do what I require. Here's the
question before I get to deeply into hacking the scripts...
Can you embed PhP in JavaScript. In other words, the Java requires that
arrays be filled. The entries into these arrays need to come from my
database which is accessed via PhP.
In Java line...
new Array()
can I embed the PhP...
><?php echo $database['field']; ?>
Thanx,
--
Robb Kerr
Digital IGUANA
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php