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!

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
253 Like 31 Dislike
Previous forums Next forums
Other forums

question about header() security
is is safe to just use the header() function to redirect someone if they are, say, not logged in? or

article site help remaining text
Hi all hope you will be fine
I am creating a article site in this site i want to put some text on

PHP & Images [Resize, Crop, Save]
Hey! Well I have a little dilema, hoping I could find some guidance.

I have a CMS and on the

Receive Rosettanet Message to SAP 4.6c
Dear all ,

My customer will send the PO details by rosettanet message , Is it

php/mysql auto logout after 2 hour and reset password
Hi all,

This I hope will make sense. I've the following code which when a user logins in, cr

Comparing two dates
Hi Guys
I have two dates I want to compare. Below is my current implementation. The problem with

Check premium expire
Hi,

I am making a simple file hosting site and want to check if users premium subscriptions h

$_FILES array
Ok,

I just started experimenting with PHP today. My goal right now is to have people be able

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

socket communication between c++/java and sending image
hi,

i have a class in c++ called win32_sockserver which creates socket to java. i am trying

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