Re: $_POST arrays not evaluated in sql statement -- why?
| From: | Joshua Moore-Oliva | Date: | Wed, 26 Feb 2003 00:21:20 +0000 |
| Subject: | Re: $_POST arrays not evaluated in sql statement -- why? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-137162@lists.php.net to get a copy of this message | ||
I believe that single quotes will display exactly what you type in, and double
quotes will actually process it.. e.g.
$foo = "hello";
echo '$foo';
You see $foo
echo "$foo";
You see hello
On February 25, 2003 09:42 pm, CF High wrote:
> Hey all.
>
> Got a problem with this sql statement -- php vars are evaluated (e.g. the
> $date var), but not the $_POST arrays..........
>
> All of the arrays return correct values -- What am I missing here?
>
> $sql = "INSERT into rosters (school_id, sport_id, date, jersey_id, first,
> last, position, grade, town, state, country, height, weight, DOB)
> VALUES
>
> ('1','1','$date','$_POST['jersey_id'][$x]','$_POST['first'][$x]','$_POST['l
>a
>st'][$x]','$_POST['position'][$x]','$_POST['grade'][$x]',
>
>
> '$_POST['town'][$x]','$_POST['state'][$x]','$_POST['country'][$x]','$_POST[
>' height'][$x]',
> '$_POST['weight'][$x]','$DOB[$i]')";
>
> I still have some hair left on my head..........
>
> --Noah
>
> --