Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/257.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何为MySQL数据操作(如update、insert)创建可用于任何表的单个php类_Php - Fatal编程技术网

如何为MySQL数据操作(如update、insert)创建可用于任何表的单个php类

如何为MySQL数据操作(如update、insert)创建可用于任何表的单个php类,php,Php,**如何为MySQL数据操作(如更新、插入)创建单个php类,这些操作可用于任何表 我希望这个类可以用于任何数据库和表Yeap,这是在Database中访问数据的最佳方式,它是PDO,但您也应该在代码中使用模式,要获得好的代码,您应该使用ActiveRecord或DataMapper模式。谷歌来理解它 我更喜欢DataMapper,因为它只有DataAccess逻辑,而不是ActiveRecord use business logic inHi,您不能只使用一个类,通常是它的min 4类。使用P

**如何为MySQL数据操作(如更新、插入)创建单个php类,这些操作可用于任何表


我希望这个类可以用于任何数据库和表

Yeap,这是在Database中访问数据的最佳方式,它是PDO,但您也应该在代码中使用模式,要获得好的代码,您应该使用ActiveRecord或DataMapper模式。谷歌来理解它


我更喜欢DataMapper,因为它只有DataAccess逻辑,而不是ActiveRecord use business logic in

Hi,您不能只使用一个类,通常是它的min 4类。使用PDO它被称为PDO。。。