I make a site for photography. The database has an image table, an event table, and a category table that are linked through foreign keys. At the moment, I am generating events when a photograph was taken from a database and turned into anchor links.
<?php while ( $a_row = mysql_fetch_row( $result ) ){ foreach ( $a_row as $field ){ ?> <a href="images.php?event=<?php echo $field;?> "> <php? echo $field; ?> </a> <?php } } ?>
When the link is clicked, the script gets the variable from get in the URL: /images.php?**event**=eventCalledParty
foreach($_GET as $value) { $event = $value; } $event = mysql_real_escape_string($event);
My question is if I had to run categories and have a url that looks like this:
?/images.php event = eventCalledParty & category = categoryCalledFashionPhotography
How would I isolate these two variables from a URL for use in my queries.
Thanks.
source share