Re: Why won't this query work?

From: Date: Mon, 24 Mar 2008 18:29:36 +0000
Subject: Re: Why won't this query work?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-272049@lists.php.net to get a copy of this message
On Mar 24, 2008, at 2:23 PM, Daniel Brown wrote:
On Mon, Mar 24, 2008 at 1:47 PM, Jason Pruim <japruim@raoset.com> wrote:
Hi Everyone, Attempting to get this query: "SELECT customerName, loginName, email, adminLevel FROM current WHERE customerBusiness=$business ORDER BY adminLevel" to work. So far it doesn't like me... It pops up saying that "Unknown column 'Raoset' in 'where clause'"
[snip!] Encapsulate your $business variable in quotes. If you don't, MySQL sees it as a relational link. Also, as a reminder, be sure to use mysql_real_escape_string($business) if you're not using mysqli_*().
It's already been escaped, $business is pulled out of the database after they log in. :)
--</Daniel P. Brown> Forensic Services, Senior Unix Engineer 1+ (570-) 362-0283
-- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424-9337 www.raoset.com japruim@raoset.com

« previous php.general (#272049) next »