Re: Problem running sql stored in the database

From: Date: Fri, 09 Apr 2004 14:33:32 +0000
Subject: Re: Problem running sql stored in the database
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-182982@lists.php.net to get a copy of this message
Jason Wong wrote:
On Friday 09 April 2004 22:24, Ryan A wrote:
If that is the case you could modify your insert query: INSERT INTO table (id, name) VALUES ('$id', '$name')
No, thats not the problem, its inserting the text "$id" and "$name" instead of the values the variables hold.
Don't use single quotes.
$sql = "INSERT INTO table (id, name) VALUES ( '" . $id . "', '" . $name . "') -- *********************************************************************** * _ __ __ __ _ * John Nichel * * | |/ /___ __ \ \ / /__ _ _| |__ ___ __ ___ _ __ * 716.856.9675 * * | ' </ -_) _` \ \/\/ / _ \ '_| / /(_-<_/ _/ _ \ ' \ * 737 Main St. * * |_|\_\___\__, |\_/\_/\___/_| |_\_\/__(_)__\___/_|_|_|* Suite #150 * * |___/ * Buffalo, NY * * http://www.KegWorks.com john@KegWorks.com * 14203 - 1321 * ***********************************************************************

« previous php.general (#182982) next »