PHP Classes

Select and Insert

Recommend this page to a friend!

      Top level forums  >  PHP Specialists  >  General  >  Select and Insert  
Subject:Select and Insert
Summary:Using the results of a Select Query as data for Insert Query.
Messages:3
Author:Dave Munro
Date:2009-01-14 16:40:04
Update:2009-01-16 10:02:22
 

  1. Select and Insert   Reply   Report abuse  
Picture of Dave Munro Dave Munro - 2009-01-14 17:36:08
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

There are 2 replies in this thread, which are not being displayed.
Browsing this forum thread replies is available only to premium subscribers.


Go to the premium subscriptions page to learn how to become a premium subscriber and have full access to this forum.