Solved

php

Posted on 2007-04-05
6
175 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 1

Accepted Solution

by:
jokerjoe6773 earned 500 total points
Comment Utility
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
Comment Utility
Would it be possible to close this question and maybe award some points?
0
 

Author Comment

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

E-commerce is quite a gambling world, and you should never entrust your business to a lucky chance. In order to outrun your competitors in a race to attract as many customers as possible, you need to have a well thought-out strategy under your belt.…
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 create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now