You are here: Re: Problems outputting to a 3 column table in order to crate an image gallery « PHP Programming Language « IT news, forums, messages
Re: Problems outputting to a 3 column table in order to crate an image gallery

Posted by Rik on 10/17/21 11:46

ste wrote:
> Likewise, going to the url:
> mywebsite.com/gallery.php?imagetype=portrait
> it opens all the images from my database which are tagged with the
> category of portrait.
>
> Is there a way to open the gallery showing ALL pictures, without
> having to re-write the sql query? i.e. is there a tag I can enter in
> a URL which displays images where the imagetype could literally be
> anything? mywebsite.com/gallery.php?imagetype=anything


just don't set the imagetype, so the url would be mywebsite.com/gallery.php,
and use this code:

//create database $connection

if(get_magic_quotes_gpc()){
$_GET['imagetype'] = stripslashes($_GET['imagetype']);
}
$imagetype = mysql_real_escape_string( $_GET['imagetype'], $connection);
$where = (isset($_GET['imagetype'])) ? "WHERE imagetype =
'".$_GET['imagetype']."'" : '';
$query = "SELECT * FROM mydatabase ".$where;

Grtz,
--
Rik Wasmus

 

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

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