Jump to content


Photo

Call database to load page


  • Please log in to reply
4 replies to this topic

#1 essential

essential
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 18 July 2006 - 10:03 AM

Hi Guys and Girl’s

I need some help, I use Dreamweaver MX 2004, have managed to build a partial site, using PHP /Mysql all talking to each other and can view live data, so that side is fine

Here is where I need help

I have s series of occupations listed and I want to have a viewer see these occupations and click (standard Hyperlink) which will go to the data base and load up a webpage.

The current site is based on 10+ individual web pages now want to streamline it.

So here goes with a semi visual explanation of what I am looking for

Page 1  (Index page) Occupation (hyperlink)
I need to know the URL to put on this link which will go to database collect information and place into a webpage (page 2) occupation.php that is already set up as an occupation template i.e. have placed  <?php echo $row_Recordset1['occupation_1']; ?> in the required places to build the page.

Database base name is services and table is called jobSearch

I assumed that all I would need to do was the following
http://www.mydomain.com/services/jobsearch=id2 (is this correct? what I can not work out is how do you put the data onto webpage (page 2)

Sorry if this goes on a bit but wanted to get it all in one go

Essential





#2 moberemk

moberemk
  • Members
  • PipPipPip
  • Advanced Member
  • 695 posts

Posted 18 July 2006 - 02:29 PM

You need to create another page with a recordset that uses a URL parameter to figure out which record to pull. When you make the occupation page, create a recordset that has the URL Parameter filter set to pull the right information based on what you passed in your url from the first page (you set that up in the bottom two input boxes).

On the first page, you just need to select the link, and click the URL folder icon. From there, select occupation.php, and look below. You'll see a little lightning icon-that's to add dynamic parameters to the page (assuming that you're using a recordset-created list of occupations) based on the id. That will create the url occupations.php?id=(ID variable here). You can also use that to input static data, if you wish.
Disclaimer: No matter how harsh I may be, I'm always IMO only.

#3 essential

essential
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 19 July 2006 - 11:27 AM

Hi moberemk

Many thanks for your prompt help.

Thank you very much I now have it to work, well almost

I have redesigned the links so as they are dynamic pulled from the database, have binded them to the id tag, and when click it loads the first page. Fantastic

Guess what happens when I click the second link? Nothing well that's not true page one opens up in fact when I click on all links all I get is page one?

Almost there?



#4 moberemk

moberemk
  • Members
  • PipPipPip
  • Advanced Member
  • 695 posts

Posted 19 July 2006 - 11:42 AM

Again, on the page, in the recordset field, you need to select to use a URL parameter for more then the first page to come up.
Disclaimer: No matter how harsh I may be, I'm always IMO only.

#5 essential

essential
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 21 July 2006 - 07:31 PM

Now working in full thanks for your help, I have listed the final Recoredset below incase it can help others

<?php do { ?>
  <li>
<a href="suppliers.php?autonumber=<?php echo $row_reSuppliers['autonumber']; ?>">
<?php echo $row_reSuppliers['coName']; ?>
<?php } while ($row_reSuppliers = mysql_fetch_assoc($reSuppliers)); ?></a></li>
&nbsp;  &nbsp;  </ul>       




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users