Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

php

Posted on 2007-04-05
6
Medium Priority
?
187 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to count occurrences of each item in an array.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
Suggested Courses

609 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