Chris W. Parker <>
on Tuesday, April 06, 2004 5:01 PM said:
let me expand both of my points in an attempt to be more verbose.
> 1. write readable queries.
> 2. always put single quotes around array keys. $array['key']
here is how i would write your query:
<?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']}'";
$sql = "
insert into $GuestbookTable
values(
NULL
, '{$_SESSION['add']['date']}'
, '{$_SESSION['add']['name']}'
, '{$_SESSION['add']['email']}'
, '{$_SESSION['add']['website']}'
, '{$_SESSION['add']['referred']}'
, '{$_SESSION['add']['comments']}')";
hth,
chris.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php