|
Posted by Jerry Stuckle on 08/22/05 05:39
Dave wrote:
> On Fri, 12 Aug 2005 18:23:37 -0400, Ward B decided we needed to hear:
>
>
>>Thanks Dave.
>>
>>Well, you're right. The column name is "task_icaodesc."
>>
>>But is the first part of this, icaodesc ='$_POST[task_icaodesc]',
>>throwing off the system? icaodesc is the NAME in the update form.
>
>
> Your assignment in the SQL statement is the wrong way around in this
> case. Your SQL statement should instead contain:
>
> task_icaodesc = '$_POST[icaodesc]'
>
> that assigns the value of the form variable icaodesc to the column
> task_icaodesc in the database. BTW, hopefully you are validating the
> value of your form variables before you update your database? - if not
> you are wide open for all sorts of problems.
>
>
>> <TD><strong>ICAO Description of Task:</strong><BR><textarea
>>name="$icaodesc" cols="30" rows="5"><? echo "$icaodesc";
>
>
> ^^^^^^ typo? Its not a good idea for the form field name to
> contain a $ sign. The field must be called icaodesc, if you are
> going to refer to it in your script as $_POST[icaodesc]
>
>
>>?></textarea></TD>
>
> <snip>
>
I think that should be:
task_icaodesc = "'" . $_POST['icaodesc'] . "'"; // or
task_icaodesc = "'{$_POST['icaodesc']}'";
The provided code will just put the characters '$_POST[icaodesc]' in the database.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|