erme Posted January 29, 2010 Share Posted January 29, 2010 Hi, I currently have something like this: $extrapart = (isset($_GET['id'][0]))?"WHERE ID='".mysql_real_escape_string($_GET['id'])."'":""; $_SESSION['extra'] = $extrapart; $pageheader = mysql_query("SELECT DISTINCT ID FROM TableName $extrapart"); not written by me which is why im so confused. I currently go to this which works fine: http://site.co.uk/page.php?id=dev002 which pulls ID from the db. But I want to be able to include the county (which is in the db) that is associated with that ID like this: http://site.co.uk/page.php?county=devon&id=dev002 Hope someone can make sense of what I'm trying to explain! Thanks to all that help! Link to comment https://forums.phpfreaks.com/topic/190258-adding-a-fieldvariable-to-url/ Share on other sites More sharing options...
erme Posted January 29, 2010 Author Share Posted January 29, 2010 Would I be right in saying I need to do something like this: $extrapart = (isset($_GET['id'][0]))?"WHERE ID='".mysql_real_escape_string($_GET['id'])."'":""; $extrapart2 = (isset($_GET['county'][0]))?"WHERE County='".mysql_real_escape_string($_GET['county'])."'":""; $_SESSION['extra'] = $extrapart $extrapart2; Link to comment https://forums.phpfreaks.com/topic/190258-adding-a-fieldvariable-to-url/#findComment-1003813 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.