Why does this returns results...
And this does not...
<?php
$database = JFactory::getDBO();
$ID = $_GET['ID']; // get var from URL
$query = "SELECT * from bridge_AgProduction2010 WHERE ID = $ID";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$County = $row['County'];
And this does not...
<?php
$database = JFactory::getDBO();
$Cty = $_GET['County']; // get var from URL
$query = "SELECT * from bridge_AgProduction2010 WHERE County = '$Cty'";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$County = $row['County'];
Hi rstevens ,
At a guess - because County isn't included in the calling URL ??? There's not much information here to make any other diagnosis.
Bob
At a guess - because County isn't included in the calling URL ??? There's not much information here to make any other diagnosis.
Bob
I bought you a beer for your time...
I included County in the calling URL...
index.php?option=com_chronocontact&chronoformname=CountyBridgeQuery&County=Adams
If I use a similar URL and get the ID instead of the County, I get a result
index.php?option=com_chronocontact&chronoformname=CountyBridgeQuery&ID=1
The database has 92 counties starting with the first one named Adams, which also has the ID of 1.
I will buy you a six pack if you can help me figure out what should be a simple problem to resolve, but I am obviously missing something.
I included County in the calling URL...
index.php?option=com_chronocontact&chronoformname=CountyBridgeQuery&County=Adams
If I use a similar URL and get the ID instead of the County, I get a result
index.php?option=com_chronocontact&chronoformname=CountyBridgeQuery&ID=1
The database has 92 counties starting with the first one named Adams, which also has the ID of 1.
I will buy you a six pack if you can help me figure out what should be a simple problem to resolve, but I am obviously missing something.
Hi rstevens,
Which version of ChronoForms are you using?
You can find the version from Site Admin | Extensions | Install/Uninstall | Components in Joomla! 1.5 or Site Admin | Extensions | Extension Manager | Manage in Joomla! 1.6/1.7/2.5.
If it is CFv4 then please try this:
Bob
Which version of ChronoForms are you using?
You can find the version from Site Admin | Extensions | Install/Uninstall | Components in Joomla! 1.5 or Site Admin | Extensions | Extension Manager | Manage in Joomla! 1.6/1.7/2.5.
If it is CFv4 then please try this:
<?php
$db =& JFactory::getDBO();
$query = "
SELECT *
FROM `bridge_AgProduction2010`
WHERE `County` = '{$form->data['County']}' ;
";
$db->setQuery($query);
$result = $db->loadArray();
$County = $result['County'];
. . .
?>
Bob
This topic is locked and no more replies can be posted.