Reply to Re: Selecting a row by value.. getting errors..

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация