Since you clever people at Chronoforms got me insrtucted in the Joomla way of writing a query I thought you might help.
I have a very simple table called jos_1_diary. This has just 4 'columns'
rec_id integer
theline smallint
thedate date
thecount smallint
I wantto find the last date in the diary because I want to extend it
SO I put a bit of PHP as
The result of running this code is:
My question is what is this 'resource id' it has nowt to do with my program.
When I run exactly the same query against the table in php myadmin
I get a sensible answer of 2010-03-08
Is this a joomla nasty ? Or is my program wrong ?
--
Dave
I have a very simple table called jos_1_diary. This has just 4 'columns'
rec_id integer
theline smallint
thedate date
thecount smallint
I wantto find the last date in the diary because I want to extend it
SO I put a bit of PHP as
$db = & JFactory::getDBO();
// first lets get current max date
$qry = "select max(".$db->nameQuote('thedate').
") from ".$db->nameQuote('jos_1_diary');
echo "qry is $qry";
$db->setQuery($qry);
$result = $db->Query();
echo "<p>max date is $result</p>";
The result of running this code is:
qry is select max(`thedate`) from `jos_1_diary`
max date is Resource id #116
My question is what is this 'resource id' it has nowt to do with my program.
When I run exactly the same query against the table in php myadmin
I get a sensible answer of 2010-03-08
Is this a joomla nasty ? Or is my program wrong ?
--
Dave