search function


Posted on 16th Feb 2014 07:03 pm by admin

HI guys,

if anyone could point us in the right direction of how to do this, or provide some test code for a similar problem would be great!

Did you know?Explore Trending and Topic pages for more stories like this.
Basically, I have user profiles on my site, and I have a search by for example firstnames will list all usernames with the first name 'bob'. With this list I want to turn the output of each name to a link to their profile.

the profile page is profile-view.php and I am using the statement "select username from members where firstname = $input";

and
$num_results = mysql_num_rows($result);


$username = $row['username'];

for ($i=0; $i <$num_results; $i++)
{
$num_found = $i ;
$row = mysql_fetch_assoc($result);
echo "<a href='profile-view.php?username = $username'>{$row['username']}</a><br/>";
}

I know the <a href> wont work, but is there anyway of being able to do this, all usernames are unique across the site too thats why I thought the link it by this.

Thanks in advance
No comments posted yet

Your Answer:

Login to answer
121 Like 35 Dislike
Previous forums Next forums
Other forums

UDP Multicast question
Hey,

Im not really in the know when it comes to network related programming and activitie

Count
Getting the same count everytime

Code:
$visitquery = mysql_query("SELECT COUNT(*) FR

search function
HI guys,

if anyone could point us in the right direction of how to do this, or provide some t

php unable to sent email
Hi, guys, I try to send a email through php but unfortunately the mail unable to sent. Here is my co

want a code for uploading and downloading
i m trying to upload and download to my site..i need upload and download code ...i use a code for up

File upload issues
Hi Guys,

Can anyone see any issues with this code:
Code: [Select]$setImage= 'productimages

moving mouse to display image coordinates
I have an existing MFC application that shows an image in the main window.
I'd like to be able to

re calling a function without including file
Hi,
i am new to programming in php, i was just checking the wordpress code and found out in the w

function not returning the correct value
I have a program that needs to return a value from a function. I have an output statement inside the

Pipe email to PHP - get mail adress from MySQL - send?
Hi all,

this is the challenge:

1) Our faculty at the college where I'm employed includ

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash