Hello,
I am working on a form for our PTO where parents can choose volunteer opportunities in their child's classroom. They need to select the teacher first and then the teacher's name will be used to create the table of opportunities.
I'm doing this by passing the input text value captured in the first form (Teacher selection) to a different form (opportunities). In the 2nd form the value is part of a SQL Query that will generate a table from a database table. The text value is captured and appears to be read correctly by CURL,
"Teacher = name"
but upon redirect I either get a parse error,
"Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$'" for the following code
<?php $name = $ _POST [\'name\']; ?>
or no error if I comment the line out, but then no table created either.
I know that it is most likely in my syntax calling the variable into the SQL Query,
<?php
$db =& JFactory::getDBO();
$query_classes = "SELECT * FROM teachers WHERE Teacher = '$name' ORDER BY `index`"; ...?>
I'd appreciate any help you could give me.
Thanks,
Marty
I am working on a form for our PTO where parents can choose volunteer opportunities in their child's classroom. They need to select the teacher first and then the teacher's name will be used to create the table of opportunities.
I'm doing this by passing the input text value captured in the first form (Teacher selection) to a different form (opportunities). In the 2nd form the value is part of a SQL Query that will generate a table from a database table. The text value is captured and appears to be read correctly by CURL,
"Teacher = name"
but upon redirect I either get a parse error,
"Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$'" for the following code
<?php $name = $ _POST [\'name\']; ?>
or no error if I comment the line out, but then no table created either.
I know that it is most likely in my syntax calling the variable into the SQL Query,
<?php
$db =& JFactory::getDBO();
$query_classes = "SELECT * FROM teachers WHERE Teacher = '$name' ORDER BY `index`"; ...?>
I'd appreciate any help you could give me.
Thanks,
Marty