Link to home
Start Free TrialLog in
Avatar of btocakci
btocakciFlag for Türkiye

asked on

php

Hi! I will make a page like this. There will be tens of authors and every author will have tens of entries.  When an author name is searched, all the headers of entries related to this author will come to the page and they will be a link to the entry they belong to.  Can you sugesst a code?  except the connection to database, and search routine.  
my database(site):
table(entry):id,author_id, header, entry, author, point
Avatar of jokerjoe6773
jokerjoe6773

I'm not sure this is what you are wanting but could you not do a query like select * from my_database where author_id="$authour_id" and pass that code in the form?

If this is not what your asking for please let me know and I'll see what I can come with

Avatar of btocakci

ASKER

thats right. I will take the entries that author_id="$authour_id". But my problem is to take the headers as a link to the entry body.
For example
author: james    entries: 1-Global warming   2-economy  3-politics   these headers will be dispayed and when i click one of this, the entry related to this header will be displayed.
you dont need to take all the headers and other info into the link,

just send the authour ID in the query string like
       <a href='file.php?id=1'>GO</a>

and the get that ID and use in select statement like
$author_id = $_GET['id'];  
SELECT * FROM TABLE WHERE id = '$author_id';

note to avoid sql injection, use
http://uk2.php.net/mysql_real_escape_string
ASKER CERTIFIED SOLUTION
Avatar of jokerjoe6773
jokerjoe6773

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
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
sorry for being late. ive just been waiting for some new ideas..thanks..