private function _SP()
{
$sql = "EXEC [DBNAME].[dbo].[SP_NAME] (?), (?), (?)";
$sql = $this->_dbconn->_dbcon->prepare($sql);
//$sql->execute(array($this->_cid, $this->_action_id, $this->_date));
$sql->bindParam(1, $this->_cid, PDO::PARAM_INT);
$sql->bindParam(2, $this->_action_id, PDO::PARAM_INT);
$sql->bindParam(3, $this->_date, PDO::PARAM_STR);
$sql->execute();
//print_r($sql);
return $sql;
/* foreach($this->_dbconn->_dbcon->query($sql) as $row)
{
echo $row["id"];
}
*/
I'm struggling to execute a MSSQL stored procedure using the PHP PDO class.
The comments indicate the various things I've tried but I can't seem to get anywhere with it.
I've been searching Google all day but it doesn't look like many people combine the languages that I've combined.
Please let me know if you can help, or at least point me to a tutorial.
Thanks
Ok so,
To answer your question Jonast92,
I'm using it in a class.
When it's returned, and I print_r() at the other end, I get this:
reports_adv_ajax_errorlogs Object
(
[_dbconn:reports_adv_ajax_errorlogs:private] => database Object
(
[_dbcon] => PDO Object
(
)
)
[_cid:reports_adv_ajax_errorlogs:private] => 4076158
[_action_id:reports_adv_ajax_errorlogs:private] => null
[_date:reports_adv_ajax_errorlogs:private] => '09-Jun-2014'
)