XML Table Export Forum :: Exporting specific item

This thread was displayed: 224 times


Starting with 17th May 2007, Adobe Systems will stop offering support for any version of the discontinued InterAKT products. As a result, we will not answer to new support incidents starting with May 17th, 2007. Pending support incidents will still be followed in order to be closed. The product forums will remain open and be transformed in user-to-user forums. The general forums will be made read-only and not allow new posts or comments.

For more information about the affected products visit: www.interaktonline.com/Support/

View Threaded Show descending
James Harrison
07-11-2006 17:17:13 GMT +2

Thought i'd share this with people; I worked it out for an application I needed it for, and it's worked great.

This basically is a mod for XML Table Export which allows you to select what gets exported with a WHERE col1=val1.

In includes\xml\XML_TableExport.class.php, find

    function setSortByField($sortByField) {
        $this->sortByField = trim($sortByField);
    }

and add below it:

    function setspecificCol($specificCol) {
        $this->specificCol = trim($specificCol);
    }
    function setspecificVal($specificVal) {
        $this->specificVal = trim($specificVal);
    }   
    function setselSpecific($selSpecific) {
        $this->selSpecific = trim($selSpecific);
    }        

Then find:

if ($this->sortByField != '') {
            $sql = 'SELECT * FROM ' . $this->table . ' ORDER BY ' . $this->sortByField . ' ' . $this->order;
        }

Add below it:

        if ($this->selSpecific != '') {
            $sql = 'SELECT * FROM ' . $this->table . ' WHERE ' . $this->specificCol . '="' . $this->specificVal.'"';
        }    


And you're in business. Save and upload the file, and in your file set up to export a whole table, edit

$xml_tableexport1->setSortByField("fieldname");

So that everything inside the "" is removed.

Then simply add:

$xml_tableexport1->setselSpecific("true");
$xml_tableexport1->setspecificCol("columname"); // Column name to use in WHERE
$xml_tableexport1->setspecificVal($_GET['value']); // Value

Obviously you can remove the $_GET and use post or just a hard-coded variable, but you get the idea. 

Hope this helps people!

Back | Reply | Quote | Top
benjamin wende
02-15-2008 23:15:18 GMT +2

rechtsanwalt - friseur, frisur - ausbildung - stellenangebote - shopping

- rimowa

akkus


great work. thx for this good solution. 


bennos


Reply | Quote | Top
XML Table Export 1.8.6
© Adobe Systems Romania. All rights reserved.