I have a search engine and im trying to open every result in a new window and am not sure what would be the best way to do it. on my search result page "search.php" I am using
$go = "go.php?url=";
print "<a href='".$go."".($row['id'])."' title='".($row['title'])."' rel='nofollow' target='_blank'>".html_entity_decode($row['title'])."</a>";
which would take you to a page like http://website.com/go.php?url=37290
37290 would be the row id and now I have to query it so I can get all the rest of the info and I am having trouble. I know this is really easy but any help would be much appreciated.
on go.php I am using this right now just to show that im grabbing the id from url=37290
<?php print $_GET['url']?>
which obviously prints out 37290 but now I need to query that id in the db and fetch the extra db info.
I need to fetch link_id, title, and url
What would be a good way to do this? Thanks.
EDIT: i would need a query like
select link_id, title, url from search1_links
I hope that shows my db structure better. The db is name is data1
I assuming I need something like
if ($_GET['url']){
sql query stuff here. }
EDIT:
My main problem is I cannot figure out how to make a query with $_GET['url'] url is the id I can do the sql I just need to know how to make a query with the id $_GET['url'] gives me.