You are here: PHP query using WHERE with AND « All PHP « IT news, forums, messages
PHP query using WHERE with AND

Posted by Harold Ralston on 03/31/06 05:10

I have been trying to learn enough PHP and MySQL to use a query with
one of my genealogy data pages, instead of viewers needing to browse
through it all. What little I have learned is from the Library Books
at our local library.

This PHP code works fine until I insert the line beginning with AND,
then it won't execute.
Have I missed some punctuation?
Thanks for any help.

$query = "SELECT pictures.markername, pictures.image,
pictures.field1, places.place
FROM pictures,places
WHERE (pictures.place_id=places.place_id)
AND (pictures.markername LIKE $surname )
ORDER BY pictures.markername ASC";
$result = mysql_query($query)
or die ("Couldn't execute query.");

 

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

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