I'm trying to send some values to SQL, but the PDO does not work as it should, or I'm forgetting something, I'm new to using PDO.
Functional code example.
$conn = new PDO('mysql:dbname=config_database;host=127.0.0.1', 'root', '');
$statement = $conn->prepare("UPDATE stream_table SET src='Funcional' WHERE start = '60'");
$statement->execute();
Example of non-functional code (I tried several other possibilities without success) (Does not return error, simply does nothing)
$conn = new PDO('mysql:dbname=config_database;host=127.0.0.1', 'root', '');
//$value = $_POST['value']; //A ideia real é pegar via POST
$value = 'C:\sample.code'; //Simplificando o test
$statement = $conn->prepare("UPDATE stream_table SET src='?' WHERE start = '60'");
$statement->bindValue(":value", $value); //Testei com bindParam e bindValue
$statement->execute();
I do not know if it's due to the apostrophes or anything else, I've followed several examples on the internet and it does not even work, it's evil .
How can I perform this command functionally?
Maybe this post here from SO-pt help.
@Edit
Error: I can not use placeholders for table or column names.