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

error reporting
hey everyone

I have a production server in which I want error reporting but only on some page

Weird Problem with curl while sending data
I am facing a weird problem with sending data to a site via curl.

If i send the value by this

error help - Dynamic Image
I've been working on making my site less cluttered in the directories and more secure lately. In an

PHP hyperlinks generator - HELP plz
Hi

I need some help to get this done using php:


1 - I have few hyperlinks say 500

Functions Not Loading Into Div
I had some help doing some of this but what I'm trying to do is get my functions to retrieve its val

Email Form Syntax Issue
I need the TO: in email to display To: CEO instead of To: abc@mail.com

How to alter the scri

Form File Upload
I've read through tons of resources and tutorials and as far as I can tell, my code is accurate, but

Auto install
Hi I have a directory lets say "apps" that I then have more folders ie "email",

Setting condidtions for an input box
Hi all,

I would like to set a condition in a txt box that says the number a user enters has t

how do i make new line after *
First check this page here. and you see my report. Im pulling form a mysql db. I want to beable to m

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