Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Sending SQL query from active page.
Old 06-05-2005, 08:42 AM Sending SQL query from active page.
Novice Talker

Posts: 8
Trades: 0
I have a form, and a PHP script that acceses a MYSQL database. The results get outputed to an HTML active page. I now want to provide links to that information to generate a further SQL query and a further active page. e.g user searches through my form for all authors with the name of Hogg. They get six results from my database. I now want them to be able to click on the author they want for further info. But I'm stuck here and my 2 PHP books don't give any info. I've found out how to create a link attached to a URL, but don't know what to do from there. I don't need a tutorial here, just any links to info on the web which will tell me where to go, then I can sort it out myself.

Bob
bobfarq is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-05-2005, 10:38 AM
0beron's Avatar
Defies a Status

Posts: 1,832
Location: Somewhere else entirely
Trades: 0
Prob the best way to go about this is to format each link to contain an identifier of which author to display. Say your authors table has fields id, name, articles, other, then your search page would look at the name field, and for each one it would echo a link looking like http://www.yoursite.com/viewauthor.php?id=5 with the number on the end being the id number of that author.

Then you write one page, in this case called viewauthor.php that gets the id number from the URL that was clicked :
PHP Code:

$idnumber 
$_GET['id'];

$resultmysql_query("lookup info for author number $idnumber...";

//display author info here 
The $_GET array contains the variable name-value pairs from after the ? in the URL.
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';

Please login or register to view this content. Registration is FREE
(aka MSN handwriting for forums)
0beron is offline
Reply With Quote
View Public Profile Visit 0beron's homepage!
 
Old 06-06-2005, 08:51 AM
Novice Talker

Posts: 8
Trades: 0
Excellent. That's what I like simple solutions. Thanks for the help.

Bob
bobfarq is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Sending SQL query from active page.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11783 seconds with 12 queries