Click here to Skip to main content
15,884,022 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello all!

So I am relatively new to using PHP (I am much more versed at using C# ASP.NET) and I was wondering what the best php extension was to interact with stored procedures on a MySQL server. So far I have looked at php_mysql.dll, php_mysqli.dll, and am now looking at php_pdo.dll.

When I was working with ASP.NET the SqlCommand object would take in a connection and a stored procedure. Then you could subsequently add SqlParameter objects in which you could specify the direction, the parameter type, the parameter value, etc.

My question, then, is which is the PHP extension that most closely represents this fine-grained level of control over stored procedure interaction?

Much appreciated!

-Moarcodeplz
Posted

 
Share this answer
 
Comments
suprcodr 8-Jun-11 10:33am    
While both responses are good, this response has exactly what I needed. Thank you for the input!
Kim Togo 8-Jun-11 15:11pm    
Thanks, and you are welcome. You can accept both solutions if you find good.
suprcodr 8-Jun-11 15:12pm    
Had no idea! Done and done.
php_sqli is definitely to be preferred over php_sql.

This is from the PHP manual, intro section to php_mysqli:
The mysqli extension allows you to access the functionality provided by MySQL 4.1 and above. More information about the MySQL Database server can be found at » http://www.mysql.com/
An overview of software available for using MySQL from PHP can be found at Overview
Documentation for MySQL can be found at » http://dev.mysql.com/doc/.
Parts of this documentation included from MySQL manual with permissions of MySQL AB.


AFAIK, php_pdo is simply an abstraction layer to provide db-independent access methods, so if you're sticking with mysql, it doesn't buy you much.

For what I think you're trying to do, have a look at the MySQLi_STMT class in the PHP manual.

Cheers,
Peter
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900