I'm having a bit of a problem with a MySQL query. Basically in my table I've got a field called name which contains a very short set of words seperated by underscores with a last underscore and timestamp on the end of it. I'm trying to use a select query with it like this one
$name = "hello_there_301220041256";
mysql_query(SELECT FROM table WHERE name = $name);
Thats just paraphrased, I'm sure the PHP is correct because it works fine if I use the id field instead so I'm guessing its the query thats causing problems. Can you use a SELECT WHERE on a field like the one I have, its in the DB defined as a CHAR. I've tried encapsulating it in quotes as well as using a % as a wildacard but I'm not getting anywhere!
I'm sure I'm missing something stupid but this is the first large MySQL backend I've really worked on so I probably missed something simple. Can anyone poin tme in the right direction.
Cheers.