Query Woes

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Query Woes

Postby timstring » 20. January 2012 23:35

This makes absolutely no sense: When I run this query:


$namepost = "Gilbert";
$Quest = "SELECT * FROM `Users` WHERE `TechID` = `$namepost`";

MySQL returns the error message: "Unknown column 'Gilbert' in 'where clause'" TechID is my column name, not "Gilbert" If I take "$namepost" out of the query and replace it with a definite value, it works
"If builders built buildings the way that programmers write programs, the first woodpecker to come along would destroy civilization."
User avatar
timstring
 
Posts: 22
Joined: 17. September 2010 02:16

Re: Query Woes

Postby Altrea » 20. January 2012 23:37

use single-quotes ' for strings, and backticks ` for table and column names.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 13 guests