473,321 Members | 1,667 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Quick Syntax Question:

40
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:

Expand|Select|Wrap|Line Numbers
  1. var opt_a = ($_POST['<?php echo $row_rs_detail['option_a']; ?>']);
This isn't working, but I don't get an error...

[PHP]var opt_a = <?php echo "$_POST[".$row_rs_detail['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.
Nov 12 '07 #1
2 1191
code green
1,726 Expert 1GB
This isn't working AND gives me an error.
What do you mean by 'isn't working' and what is the error?
What values do the variables contain?
Nov 13 '07 #2
mwasif
802 Expert 512MB
This should fix your problem if $row_rs_detail is a resultset.
[PHP]var opt_a = <?php echo $row_rs_detail['option_a']; ?>;[/PHP]
Why you are using $_POST?
Nov 13 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Christopher Benson-Manica | last post by:
If you had an unsigned int that needed to be cast to a const myClass*, would you use const myClass* a=reinterpret_cast<const myClass*>(my_val); or const myClass* a=(const myClass*)myVal; ...
8
by: Menon | last post by:
Hi folks I am not at all an SQL server guy (more of an Oracle developer.) I wanted to know if you guys could tell me if SQL Server supports objects in the database. If so, could you kindly point...
14
by: PengYu.UT | last post by:
Hi, I have been using C++ a lot and I've almost forgot what syntax is support by C and what syntax is support by C++? My feeling is that C++ gives programmer much flexibility. And the code is...
8
by: Phil Latio | last post by:
What is the technical name or the name most commonly used for the below? United Kingdom >Wiltshire >Trowbridge Basically you have a table like: category_id, parent_category_id, category_name ...
4
by: learning_codes | last post by:
Hi, What is the difference between Visual Basic and Access XP VBA? Thanks
5
by: Robocop | last post by:
Is it possible to do something like this syntactically: year = '2008' month = '09' limit = '31' for i in range(1,limit): temp = Table.objects.filter(date = year'-'month'-'i) <----screwed...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.