Hi,
I am trying to use input from an HTML form, 'post' this numeric value and (using PHP) query it against a mySQL database. This all works if I 'manually' enter the value (eg .'100') into the code/script but I cannot amend the value via an HTML 'edit' <INPUT> box.
Please find to follow my code:
<form method="post" action="matchingbills_curAZL.php" name=norwel>
<table>
<tr>
<td>Select an Office: </td>
<td><select name="s_office"><option value=p4norint selected>London</option><option value=p4exeint>Exeter</option><option value = p4manint>Manchester</option></select></td></tr><tr>
<td>Select Money on Matter: </td>
<td><select name="s_balance">
<option default value="and matter.bills_bal+cur_bal=0">Exactly</option>
<option value="and matter.bills_bal + cur_bal between -100 and 100">Within £100</option>
<!-- THIS LINE DOES NOT WORK - I NEED TO SOMEHOW BE ABLE TO USE THE USER-DEFINED VALUE "$s_min_balance" FOR EACH POSTING OF THE FORM. THE FORM DOES WORK FOR 'HARDCODED VALUES eg. '0' & '100'.
IS THERE A WAY TO INCLUDE php IN THE mySQL QUERY STRING OR MUST IT BE RESOLVED OUTSIDE OF THE QUERY AND THEN REFERRED TO IN EXECUTION?
-->
<option value="and matter.bills_bal + cur_bal between <?php -$s_min_balance ?> and <?php $s_min_balance ?>">Enter Value Below ...</option>
</select>
</td></tr>
<tr valign=top>
<td>Select minimum balance<br>to obtain a selective report: </td>
<td><input name="s_min_balance"></td>
</table>
</form>
It falls over when executing the query:
Warning: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 12: Incorrect syntax near 's_min_balance'., SQL state 37000 in SQLExecDirect in C:\Inetpub\ on line 100
Unable to query Norwel Database
Any help would be greatfully appreciated.
Thanks
Andy
I am trying to use input from an HTML form, 'post' this numeric value and (using PHP) query it against a mySQL database. This all works if I 'manually' enter the value (eg .'100') into the code/script but I cannot amend the value via an HTML 'edit' <INPUT> box.
Please find to follow my code:
<form method="post" action="matchingbills_curAZL.php" name=norwel>
<table>
<tr>
<td>Select an Office: </td>
<td><select name="s_office"><option value=p4norint selected>London</option><option value=p4exeint>Exeter</option><option value = p4manint>Manchester</option></select></td></tr><tr>
<td>Select Money on Matter: </td>
<td><select name="s_balance">
<option default value="and matter.bills_bal+cur_bal=0">Exactly</option>
<option value="and matter.bills_bal + cur_bal between -100 and 100">Within £100</option>
<!-- THIS LINE DOES NOT WORK - I NEED TO SOMEHOW BE ABLE TO USE THE USER-DEFINED VALUE "$s_min_balance" FOR EACH POSTING OF THE FORM. THE FORM DOES WORK FOR 'HARDCODED VALUES eg. '0' & '100'.
IS THERE A WAY TO INCLUDE php IN THE mySQL QUERY STRING OR MUST IT BE RESOLVED OUTSIDE OF THE QUERY AND THEN REFERRED TO IN EXECUTION?
-->
<option value="and matter.bills_bal + cur_bal between <?php -$s_min_balance ?> and <?php $s_min_balance ?>">Enter Value Below ...</option>
</select>
</td></tr>
<tr valign=top>
<td>Select minimum balance<br>to obtain a selective report: </td>
<td><input name="s_min_balance"></td>
</table>
</form>
It falls over when executing the query:
Warning: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 12: Incorrect syntax near 's_min_balance'., SQL state 37000 in SQLExecDirect in C:\Inetpub\ on line 100
Unable to query Norwel Database
Any help would be greatfully appreciated.
Thanks
Andy