note 26749 added to function.define

From: Date: Mon, 11 Nov 2002 18:55:39 +0000
Subject: note 26749 added to function.define
Groups: php.notes 
Request: Send a blank email to php-notes+get-39307@lists.php.net to get a copy of this message
If you are looking to use constants in SQL statements then you need to have the constant names OUTSIDE your sql string for proper use i.e. define('EMAILS', 'fo2_emails'); $query = "INSERT INTO " . EMAILS . "(name) VALUES ('$name')" Note: I know that this is obvious but it's the kind of thing that catches newbies, so ... I suspect it actually catches most people the first time they use constants w/ SQL. -- http://www.php.net/manual/en/function.define.php http://master.php.net/manage/user-notes.php?action=edit+26749 http://master.php.net/manage/user-notes.php?action=delete+26749 http://master.php.net/manage/user-notes.php?action=reject+26749

« previous php.notes (#39307) next »