In my web application we query a database table based on a fieldname and compare to option but was asked to add a section to the output and that comes from another table. Here is the code as it stands now:
[php]$stmt = mysqli_prepare($link, "SELECT Barcode
, DSN
, FromID
, ToID
, Reason
, Active
, CONVERT_TZ(ModifiedDate
, ‘+00:00’, ?) as LocalModifiedDate FROM EvidenceCOC
Where " . (!$AllData ? “Active
=1 AND " : “”) . "$Fieldname
$CompareType ? ORDER BY Barcode
, ID
DESC, Active
DESC, ModifiedDate
DESC”);
mysqli_stmt_bind_param($stmt, ‘ss’, $Timezone, $_GET[‘Value’]);
/* execute prepared statement */
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt, $outBarcode, $outDSN, $outFromID, $outToID, $outReason, $outActive, $outModified);[/php]
Barcode is in both tables and when I do a join query in phpmyadmin on the database it works fine but when I add it to the above code it doesn’t work. Thanks!