在PHP 5.0 +,MySQL 5.2+之间用于存储过程的最佳扩展 [英] Best extension to use for stored procedures between PHP 5.0+, MySQL 5.2+

查看:84
本文介绍了在PHP 5.0 +,MySQL 5.2+之间用于存储过程的最佳扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!



所以我使用PHP相对较新(我更熟悉使用C#ASP.NET)我想知道什么是最好的php扩展是与MySQL服务器上的存储过程进行交互。到目前为止,我已经查看了php_mysql.dll,php_mysqli.dll,现在正在查看php_pdo.dll。



当我使用ASP.NET时,SqlCommand对象将接受连接和存储过程。然后你可以随后添加SqlParameter对象,你可以在其中指定方向,参数类型,参数值等。



我的问题是,那是哪个是PHP扩展最能代表对存储过程交互的细粒度控制吗?



非常感谢!



-Moarcodeplz

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

推荐答案

此链接从PHP调用存储过程 [ ^ ]可在 MySQL文章,提示&小部件 [ ^ ]
This link Call a stored procedure from PHP[^] is found under MySQL Articles, Tips & Snippets[^]


php_sqli肯定比php_sql更受欢迎。



这是来自PHP手册,介绍部分到php_mysqli:

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只是一个抽象层提供独立于数据库的访问方法,所以如果你坚持使用mysql,它就不会给你带来太多的好处。



我认为你想做什么,看看PHP手册中的MySQLi_STMT类。



干杯,

Peter



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


这篇关于在PHP 5.0 +,MySQL 5.2+之间用于存储过程的最佳扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆