The user is supposed to enter the height a plant normally grows to. An acceptable answer may be 6'. I have a textbox for the number and use JavaScript to verify it is a number. That works fine. I have two radio buttons that ask Inches or Feet because some people do not know the difference.
The height is saved as $_POST["height"] while the unit of measurement is $_POST["uom"].
To see what option the user chose, I use a basic if statement...
Expand|Select|Wrap|Line Numbers
- if($_POST["uom"] == 'feet')
- {
- $height = $_POST["height"] . "\"'"\";
- }
- else
- {
- $height = $_POST["height"] . "\"""\"
- }
Warning: SQL error: [unixODBC][Pervasive][Pervasive ODBC Client Interface][Pervasive][ODBC Engine Interface]Syntax Error: ion, border,accent,groundcolor,erosion_control,cut_flow er,wet,dry,boddy,fragrant,key_benefits,growth) VALUES( 'shade', 's', 's', 'd', '', '', '', '', '', '', '', '', 1, 0, 0, 1, '', 5\<< ??? , SQL state 37000 in SQLExecDirect in /var/www/html/plantbase/new_entry.php on line 578
I know the problem is with the "\"""\" portion because I have tested this every which way and it all works until I try inserting the " or ' symbol. Any ideas on how to get this to work?
Thanks very much!