btocakci
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
my database(site):
table(entry):id,author_id,
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.
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
sorry for being late. ive just been waiting for some new ideas..thanks..
If this is not what your asking for please let me know and I'll see what I can come with