Jump to content

Help making links perform MySQL queries, or maybe something better?


adamscottmartin

Recommended Posts

Hi,

 

I have 2 databases:

One is called partnumbers and contains a list of part numbers.

One is called bluefiles and has entries with the part numbers in the previous table that define file names.

 

So far I have this as a test:

A while function that will find every entry in the partnumbers table and print out a nice table with the info.

A while function that will find every entry in the bluefiles table and print out a nice table with the info.

A search box at the top of the page where you can search the partnumbers database for records (not really important except to note that I already have form handlers somewhat in place for the simple features the search box performs).

 

Basically what I want is this:

When a user clicks on a link in the partnumbers table that I print out to the screen, I want it to peform a query to the bluefiles database and print out a table with information specific to that part.  For instance if the user clicks a link for the part 'computer xyz' I want it to find all the relevant records in the bluefiles database with that part number.  I know how to do this with a query or (in the case of my search box) using form data passed through the $_POST associative array.  Is there any way to do this inline with a link?  Am I thinking too hard today about a simple issue?  Does anyone even understand what I just typed?

 

</brainmeltdown>

 

Thanks to anyone with suggestions, don't know why I am stuck today but I'm a bit of a newb sometimes...

OK so my brain just got off it's lazy self and figured out an easy way to do this...I knew it would happen but I thought it would take several hours first...

 

Anyways, the easiest way (for my application) would be to make inline forms for each of the partnumbers.  Each form would have a hidded field which would pass the data to the $_POST array and a submit button that looks like a file folder or something clever.  Then all I have to do is place a few more handlers on this page and voila!  Maybe 10 lines of code and I am done.

 

Why did that seem so hard?

Archived

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

×
×
  • Create New...

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.