MySQLi query where target from $_GET is a column?
Hello,
I have a query where we are using a JumpMenu to refresh the page and use a $_GET URL variable to return a recordset. The Query works in PHP MyAdmin but not in the MySQLi behaviour. Is it a limitation or incorrect use from my side?
<?php
$Recordset1 = new WA_MySQLi_RS("Recordset1",$redacted_i,0);
$Recordset1->setQuery("SELECT * FROM applications WHERE ? = 1 ORDER BY applications.id DESC");
$Recordset1->bindParam("s", "".$_GET['id'] ."", "PosLG"); //target
$Recordset1->execute();
?>
I've also tried defining the URL variable as a proper page level variable but it still does not work:
<?php $target = $_GET['id']; ?>
<?php
$Recordset1 = new WA_MySQLi_RS("Recordset1",$redacted_i,0);
$Recordset1->setQuery("SELECT * FROM applications WHERE ? = 1 ORDER BY applications.id DESC");
$Recordset1->bindParam("s", "".$target ."", "PosLG"); //target
$Recordset1->execute();
?>
The point of the recordset is to check one of a number of columns for a value of 1. The column name is chosen from a JumpMenu that refreshes the page setting a url such as .....php?id=PosGS