Being 'test' a table and a 'test_view' a simply view of 'table' (CREATE VIEW test_view AS SELECT * from test
)
Why the following code doesn't work?
$stmt = mysqli_prepare($conn, "SELECT * FROM test_view LIMIT 3");
mysqli_stmt_execute($stmt);
Results is:
array(3) {
["errno"]=>
int(1615)
["sqlstate"]=>
string(5) "HY000"
["error"]=>
string(42) "Prepared statement needs to be re-prepared"
}
While this one with table works
$stmt = mysqli_prepare($conn, "SELECT * FROM test LIMIT 3");
mysqli_stmt_execute($stmt);
It seams that prepare
doesn't work on views. Any suggestions?