Re: Problems outputting to a 3 column table in order to crate an image gallery
- From: "Rik" <luiheidsgoeroe@xxxxxxxxxxx>
- Date: Sun, 30 Apr 2006 13:42:01 +0200
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
.
- Follow-Ups:
- References:
- Prev by Date: Re: Regex - how to match until something
- Next by Date: Re: Problems outputting to a 3 column table in order to crate an image gallery
- Previous by thread: Re: Problems outputting to a 3 column table in order to crate an image gallery
- Next by thread: Re: Problems outputting to a 3 column table in order to crate an image gallery
- Index(es):
Relevant Pages
|