Hi all, I have a really quick syntax problem I can't seem to hammer out...
In my script, I am trying to set a variable based upon an entry from my SQL table. Here's two different lines of code I've tried, but neither of them seems to work:
[CODE=php]var opt_a = ($_POST['<?php echo $row_rs_detail['option_a']; ?>']);[/CODE]
This isn't working, but I don't get an error...
[PHP]var opt_a = <?php echo "$_POST[".$row_rs_detai l['option_a']."]"; ?>;[/PHP]
This isn't working AND gives me an error.
I apologize in advance for being a javascript and php newbie... maybe I'm going about this the wrong way. Any suggestions?
Thanks in advance.
In my script, I am trying to set a variable based upon an entry from my SQL table. Here's two different lines of code I've tried, but neither of them seems to work:
[CODE=php]var opt_a = ($_POST['<?php echo $row_rs_detail['option_a']; ?>']);[/CODE]
This isn't working, but I don't get an error...
[PHP]var opt_a = <?php echo "$_POST[".$row_rs_detai l['option_a']."]"; ?>;[/PHP]
This isn't working AND gives me an error.
I apologize in advance for being a javascript and php newbie... maybe I'm going about this the wrong way. Any suggestions?
Thanks in advance.
Comment