Hello peeps,
Im writing a script which among other things adds a record to a table. Depending on the user input, data may need to be added to 2 tables (one of which is a many-to-many resolution). The problem area of my code is as follows:
}elseif (isset($_POST['A_OR_B'])){
// Put quotes around the A_or_B value.
$A_or_B = $dbo->qstr($_POST['A_OR_B'],get_magic_quotes_gpc());
// Create SQL statement.
$sql = 'SELECT * '.
'FROM ExclusionHarmonics '.
'WHERE A_or_B = '.$A_or_B.' AND '.
'DegreeN = '.$_POST['DEGREE'].' AND '.
'OrderM = '.$_POST['ORDER'];
debug_echo($sql);
$exclusionHarmonics = $dbo->Execute($sql);
rs2html($exclusionHarmonics);
The debug_echo() function prints the following to the screen (depending on the user input of course):
SELECT * FROM ExclusionHarmonics WHERE A_or_B = 'A' AND DegreeN = 1 AND OrderM = 0
So im quite sure the SQL is ok. I am also 100% sure that there is a record already existing in the ExclusionHarmonics table with the relative data.
The rs2html() function is an ADOdb function that produces a html table containg the recordset($exclusionHarmonics). This does not output anything. (I would have expected it to produce a table containing 1 row)
Finally, The code is followed by an if statement with the following condition:
if (isset($exclusionHarmonics->fields[0]))
This is also ADOdb, and should return true. But it doesn't, the contents of the if statement are not executed as expected, and the program continues.
Can anyone see any obvious (or not so obvious) mistakes? Or can anyone recommend any thing helpful at all?
😕
TYIA