You are here: RE: [PHP] select statement with variables ??? « PHP « IT news, forums, messages
RE: [PHP] select statement with variables ???

Posted by Jay Blanchard on 12/21/05 15:33

[snip]
> $query=" SELECT title FROM $cat WHERE id='$id'";
[/snip]

echo $query; // does it look right to you?
Alway throw an error when in question

if(!($result = mysql_query($query, $connection))){
echo mysql_error() . "<br>\n";
exit();
}

My bet is that you need to concatenate

$query = "SELECT title FROM " . $cat . " WHERE id = '". $id ."' ";

 

Navigation:

[Reply to this 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

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