2

I want to make a query select data :

$pdo = new PDO($dsn, $user, $pass, $options);
$query = "SELECT ? FROM ? WHERE ? = ?";
$pdo->prepare($query);

How can I do it?

MOT EL
  • 182
  • 10
  • Possible duplicate of [Can PHP PDO Statements accept the table or column name as parameter?](https://stackoverflow.com/questions/182287/can-php-pdo-statements-accept-the-table-or-column-name-as-parameter) – Mike Sep 29 '18 at 02:57
  • It's Ok, But it's deference. If I follow that way when I echo $pdo It's will show ("SELECT dataname FROM tablename WHERE id = ?") is the same. What i need is if echo $pdo will show "SELECT ? FROM ? WHERE ? = ?" for security. If i use that function $query will convert to another. – MOT EL Oct 04 '18 at 09:18
  • Please read the answers from the link above to find out what options you have. What you are trying to do is not possible. – Mike Oct 04 '18 at 19:37

1 Answers1

2

PDOpreapare statement is not support this query right row

LY MOT
  • 66
  • 4