oriecat
09-15-2006, 08:33 PM
Hi, I hope I am putting this question in the right place, I am not entirely sure where it needs to be... I am working on a project, where I want to pull various emails from the database, display them on a page, then be able to click something to email all of them. I have two parts working, but I need to connect them. I have the database and I am able to query it and output what I need. It is currently outputting as email links, using this:
if ($myrow = @mysql_fetch_array($result))
{echo "<UL>";}
do
{
echo "<LI>";
echo "<A HREF=mailto:\"",$myrow["email"],"\">",$myrow["Name"];
echo "</A>"; "<BR>";
} while ($myrow = @mysql_fetch_array($result));
What I really need is for that information to instead end up like this, inside the javascript code:
//Set name and email for each employee:
var employee=[];
employee[0]=['Name 1', 'email1'];
employee[1]=['Name 2', 'email2'];
employee[2]=['Name 3', 'email3'];
Is this possible? I am a complete moron at this stuff, I can't believe I've even gotten it to work this far. Thanks :)
if ($myrow = @mysql_fetch_array($result))
{echo "<UL>";}
do
{
echo "<LI>";
echo "<A HREF=mailto:\"",$myrow["email"],"\">",$myrow["Name"];
echo "</A>"; "<BR>";
} while ($myrow = @mysql_fetch_array($result));
What I really need is for that information to instead end up like this, inside the javascript code:
//Set name and email for each employee:
var employee=[];
employee[0]=['Name 1', 'email1'];
employee[1]=['Name 2', 'email2'];
employee[2]=['Name 3', 'email3'];
Is this possible? I am a complete moron at this stuff, I can't believe I've even gotten it to work this far. Thanks :)