Good DAL library for PHP which has the similar .Net's feature: command.Parameters.AddWithValue("@demographics", demoXml)
the question is very straightforward: Good DAL library for PHP which has the similar .Net's feature: command.Parameters.AddWithValue("@demographics", demoXml).
mysqli extension is good but I want to have the aforementioned feature too. Putting many "?" does not开发者_运维知识库 look nice and rather confusing when a table has many fiends (>= 8). Thanks in advance!
PDO has named parameters.
e.g.
$stmt = $pdo->prepare('INSERT INTO foo (id,x) VALUES (:id,:value)');
$params = array();
$stmt->bindParam(':id', $params['id']);
$stmt->bindParam(':value', $params['value']);
$params['id'] = 200;
$params['value']= 1100;
$stmt->execute();
$params['id'] = 201;
$params['value']= 1101;
$stmt->execute();
or
$stmt = $pdo->prepare('INSERT INTO foo (id,x) VALUES (:id,:value)');
$stmt->execute( array(':id'=>200, ':value'=>1100) );
$stmt->execute( array(':id'=>201, ':value'=>1101) );
精彩评论