Jump to content

Archived

This topic is now archived and is closed to further replies.

essential

Call database to load page

Recommended Posts

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
[b]http://www.mydomain.com/services/jobsearch=id2[/b] (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



Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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>       

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.