Solved

php

Posted on 2007-04-05
6
181 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
  • 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 1

Accepted Solution

by:
jokerjoe6773 earned 500 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 500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How has this flight information been added to this website? 7 31
what do I need to host my own web sites? 13 50
Wordpress Pagination 1 28
JQuery Search Filter 2 27
Every business owner understands the significance of online customer reviews and the impact it can have on sales and revenues. With technology advancing at such a rapid pace, getting online reviews has never been easier, especially when many regions…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

808 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