Jump to content

Use part of the output of a Select Query as data for an Insert Query


dpmunro

Recommended Posts

As someone who has just started working with PHP and MYSQL I have little experience, as a result this problem may be relatively simple for others to answer - but I am having some problems with it.

 

I have used the ezsql class for the queries that I hve created and all works very well, however what I would now like to try would seem to be beyond my current abilities.

 

The selection form is a simple Options Form, the select query could be one of several but following is an example;

 

if ($Stype=='regno'){$request=("SELECT scrape_id AS 'Scrape Number', reg_no AS 'Registration', mfr_name AS 'Manufacturer', model AS 'Model or Type', con_no AS 'Con Number', owner AS 'Owner or Operator', status AS 'Status', faadate AS 'Last Reported Date' FROM scrape, type WHERE type_key=type_id AND reg_no='$sstr' ORDER BY faadate");}

 

The PHP used to display the results is;

 

echo "Your search for '$sstr' produced the following results.";

$data = $db->get_results($request);

$db->debug();

 

The result set could be many row of data, the question is :-

 

How could I add a check box to the end of each row of data and a submit button to the bottom of the results such that when one or more rows is checked the results could be submitted to an other table?

 

Regards

 

Dave Munro

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.