I am looking to have my sql query ( that is put into php) put into a javascript variable to put on the screen for my npc dialogue:
i.e (quick example not exact)
$getdetails=mysql= Select * from quests WHERE npc='Person"
While ($row= mysql_fetch_array($getdetails)
{
$activequest= $row['questname'];
$showactive= "<tr> <td> $activequest </td></tr>";
}
(i have the dialogue in a html table where the options pop up for a user to click on)
this would make a list of results as a list:
-quest one
-quest two
-quest three
how do i get that list of results from my php to show onto my screen through a javascript variable and put it on the screen so a user can choose which quest theyd like to get dialogue for -- im using innerhtml to put the dialogue on the screen for the regular static options which works fine id like to do the same for the result options so if there is 3 quests they are listed or if there is 5 quests they are listed etc.