?
Solved

php

Posted on 2007-04-05
6
Medium Priority
?
186 Views
Last Modified: 2013-12-12
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
0
Comment
Question by:btocakci
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 1

Expert Comment

by:jokerjoe6773
ID: 18860207
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

0
 

Author Comment

by:btocakci
ID: 18860232
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.
0
 
LVL 14

Expert Comment

by:Aamir Saeed
ID: 18861125
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
0
Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

 
LVL 1

Accepted Solution

by:
jokerjoe6773 earned 2000 total points
ID: 18866172
ok then do what I said before where you do the query for all entries for that author then for the entries either pass the entry id to the sql database to retreive that entry of you could do a query lilke this
select * from my_database where author_id="$author_id" and entry like '%$entry%'

Personally I would just populate the results with the entry id number attached so you went right to the entry. Something like:
<a href="yourpage.html?entry=<?echo $entry_id; ?>">

Does this help?
0
 
LVL 1

Assisted Solution

by:jokerjoe6773
jokerjoe6773 earned 2000 total points
ID: 18964946
Would it be possible to close this question and maybe award some points?
0
 

Author Comment

by:btocakci
ID: 18966048
sorry for being late. ive just been waiting for some new ideas..thanks..
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to implement server side field validation and display customized error messages to the client.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question