[TYPO3-dev] Stupid Stupid Stupid

Fr. Simon Rundell SCP simon at rundell.org.uk
Tue Jun 24 09:36:15 CEST 2008


 I freely admit to you all that I've not been good at coding extensions
using the API, and this really basic and stupid question hopefully will mark
a turn in that:

Previously, to extract data into an array, I would have written:

       $sql="SELECT * FROM ".$data["database"]." WHERE
uid=".$data["drpRecordSelect"];
       $newdata = $this->get_data($sql); // this is a function which queries
and returns the array

and I know I should use exec_SELECTquery, so

global $TYPO3_DB;

        $newdata=$TYPO3_DB->exec_SELECTquery('*', $data["database"],
'uid='.$data["drpRecordSelect"], '', '', '');

so why isn't it returning anything? Am I not referencing the database object
right (should it be $GLOBALS["TYPO3_DB"]) or is there something else
fundamental in that. Sorry fpr asking such a basic question, but if I crack
this then I promise I'll write nice secure, API-wrapped queries in future.
:-)

Fr. S



-- 
Fr. Simon Rundell SCP
Parish of S. Thomas the Apostle, Elson
The Vicarage, 21 Elson Road, Gosport, Hants, UK, PO12 4BL
Tel: 02392 582824 Mob: 07976 802123
email: simon at rundell.org.uk
web: http://www.saintthomaselson.org.uk
blog: http://frsimon.wordpress.com


"I came that you may have life - life in all its fullness"
John 10:10

READ CAREFULLY. By reading this email, you agree, on behalf of your
employer, to release me from all obligations and waivers arising from any
and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap,
clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and
acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with
your employer, its partners, licensors, agents and assigns, in perpetuity,
without prejudice to my ongoing rights and privileges. You further represent
that you have the authority to release me from any BOGUS AGREEMENTS on
behalf of your employer.




More information about the TYPO3-dev mailing list