Posted by Rik on 12/09/06 04:52
Mwahahahahaaahaa wrote:
> //$queryString = "Select * FROM '" . $Table . "' WHERE 'month' LIKE "
> . $selField;
> $queryString = "SELECT * FROM 2006 WHERE month = 'dec' ";
> $result = mysql_query($queryString) or die(mysql_error());
You seem to be headed towards the problem with your commented out query,
unfortunately the wrong kind of quoting:
$queryString = "SELECT * FROM `{$Table}` WHERE `month` LIKE '{$selField}'";
IMPORTANT:
- always use backticks `` (NOT '') around field & tablenames.
- always quote strings.
Normally it's not strictly necessary to backtick table & fieldnames, but
it's good practise and avoids problems like this.
--
Rik Wasmus
Navigation:
[Reply to this message]
|