I'm kinda wondering why I'm getting this. I have this code and it works fine.
Code:extract(get_object_vars($post)); $conn = OracleDaoFactory::createConnection(); $query = "insert into weblog_posts(title, excerpt, body, created_at) values(:title, :excerpt, :body, :createdAt)"; $stmt = ociparse($conn, $query); ocibindbyname($stmt, ':title', $title); ocibindbyname($stmt, ':excerpt', $excerpt); ocibindbyname($stmt, ':body', $body); ocibindbyname($stmt, ':createdAt', $createdAt); ociexecute($stmt) or die(ocierror());
But this doesn't work.
Code:extract(get_object_vars($post)); $conn = OracleDaoFactory::createConnection(); $query = "insert into weblog_posts(title, excerpt, body, created_at) values(:title, :excerpt, :body, :createdAt)"; $stmt = ociparse($conn, $query); oci_utility($stmt, array(':title' => $title, ':excerpt' => $excerpt, ':body' => $body, ':createdAt' => $createdAt)); ociexecute($stmt) or die(ocierror());
When oci_utility is just a wrapper on binding
Code:function oci_utility(&$stmt, $parameters = array()) { foreach ($parameters as $name => $value) { ocibindbyname($stmt, $name, $value); } }
Any help is greatly appreciated. Thanks a lot.




Reply With Quote