WordPress and Stored procedure
-
Hi all,
i’m new in wordpress, i’v try to run stored procedures in wordpress in a custome page like this :$sql="CALL test1();"; $posts = $wpdb->get_results($sql); print("<ul>"); foreach ($posts as $post) { print('<li>'.$post->TP.'|'.$post->STP.'<br/>'); print('</li>'); } print("</ul>");
but an error return :
“WordPress database error: [PROCEDURE sgo.test1 can’t return a result set in the given context]”So i’v found a solution to be able to run stored procedure.
In file “wp-dp.php” in function “db_connect()” you have to replace the end of the mysql_connect line :
$this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, true );
with :
$this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, false,65536 );
But… since i’v modified this line some plugins have some problems to executes their own queries.
Some one have a solution ?
Thanks
Shaan
- The topic ‘WordPress and Stored procedure’ is closed to new replies.