Link to home
Start Free TrialLog in
Avatar of helpchrisplz
helpchrisplz

asked on

php search results that have link on them

hey people.

i have a search box that posts to my search.php page and i have it displaying UserName and userID and UserEmail according to the search term
 i am trying to add a link to go to that users profile. am not sure how to add this?
 here is a screen shot what it look like:
thank you





$query="SELECT * FROM members WHERE UserName OR UserEmail LIKE '%".$Search."%'"; 
	$result=mysql_query($query) or die ("bad query '$query' : ".mysql_error());
	if (mysql_num_rows($result)>0) {
		  while ($res=mysql_fetch_array($result)) {
		  	echo $res['UserEmail'].'<br>';	
		  	echo $res['UserName'].'<br>';	
			echo $res['MemberID'].'<br>';
		  }
	}else{
		echo 'No results';
	}

Open in new window

search.png
ASKER CERTIFIED SOLUTION
Avatar of Rik-Legger
Rik-Legger
Flag of undefined image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of helpchrisplz
helpchrisplz

ASKER

ok so yes that will work now do i have the member id still? i see it in the browser address box. i need it in a variable to pull the searched users content in. can u explain that bit? sorry i am learning
You can retreive that with $_GET['id'],
but these are really the basics. Perhaps you should read some PHP tutorials first.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
yes thank you :)