RE: [PHP] confused big time
| From: | Martin Towell | Date: | Wed, 07 Apr 2004 00:33:31 +0000 |
| Subject: | RE: [PHP] confused big time | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-182576@lists.php.net to get a copy of this message | ||
> > um...im not doing selects im doing inserts with variable names... i
> > understand the idea with select but thats not the deal....its an
> > insert...
>
> i was hoping that wouldn't cause any confusion, but i guess
> it did. the
> thing to remember is that a query is a query. you know, parts
> is parts.
>
> here is your first query, written better.
>
> <?php
> $sql = "
> INSERT INTO $EventsTable
> VALUES
> ( NULL
> , '{$_SESSION['add']['type']}'
> , '{$_SESSION['add']['start_date']}'
> , '{$_SESSION['add']['end_date']}'
> , '{$_SESSION['add']['name']}'
> , '{$_SESSION['add']['county']}'
> , '{$_SESSION['add']['discription']}'
> , '{$_SESSION['add']['StartingDay']}'
> , '{$_SESSION['add']['StartingMonth']}'
> , '{$_SESSION['add']['StartingYear']}'
> , '{$_SESSION['add']['EndingDay']}'
> , '{$_SESSION['add']['EndingMonth']}'
> , '{$_SESSION['add']['EndingYear']}'";
>
> ?>
Also noting that there's no closing parenthesis... But maybe it's being
added in a following line.
Martin