I've got a variable set at the top of my PHP:
$abc = "paid";
Now I need to pass it on to the below query as a column name. I tried the below but it did not work.
$sql = "SELECT customerID FROM payments WHERE :myVar = :credit";
$stmt = $connect->prepare($sql);
$stmt->execute(array(':credit'=>"0", ':myVar'=>$abc));
How do I pass $abc
on to the select query as a column name?