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
121 Like 35 Dislike
Previous forums Next forums
Other forums

Looping Problem
I've got a client that has a database with about 200 events at any given time. I'm trying to loop t

Image DPI
Hi.

I allow users to upload images, the user then is able to adjust several settings for the

Problem with HTML form
Hello,

I made a HTML form with some fields and check box.
Everything works fine except whe

browse folder only
hi,
is there a way i can browse or get the directory or folder only and not the file?
i just w

How to get all server headers like Live http Headers does
Hey all, like many of you I use the Firefox addon "Live http Headers". I'm trying to write

mysql UNION | warning mysql_fetch_array !!
Code: <?php
$i = 0;
$query1="SELECT * FROM `products` WHERE `div

Help With editting and deleting form
Hallo !!

So look at this image :

http://img194.imageshack.us/img194/8272/snapshot5f.pn

writing a screen scraper
Hello,

I'm writing a screen scraper application and want to be able to get absolute addresses

update 2 columns by doing inner 2-column query
Hi,
is something like this possible?

update contract_all set col1,col2 =
(

How to restrict the display of report variants
Hello All,

I want t know how to restrict the display of report variants.
I mean, whe

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