|All requests||>||What is the best PHP crud class?||>||Request new recommendation||>||Featured requests||>||No recommendations|
by ahmed aabuzaid - 6 years ago (2016-03-26)
I would like to know how to create CRUD interface with PHP. I want sample code.
3. by Fransim - 8 months ago (2022-01-25) Reply
2. by Hariharan Natarajan - 4 years ago (2017-10-31) Reply
It helps a lot
1. by Anichandran Ayysamy Ayyanallur - 5 years ago (2017-08-23) Reply
See https: github.com slavkoss fwphp for newest code. On B12phpfw global-shared core code skeleton package (abstract class Config_allsites and trait Db_allsites) are 3 main packages (Oracle Forms modules subgroups in modules group folder glomodul, each module in own folder, no M, V, C folders for all modules-CRUD pages) : 1. Mnu (menus), 2. Mkd (WYSIWYG markdown editor eg Simplemde, or may be HTML editor eg Summernote), 3. Msg (blog based on best blogs I could find in learning sources on Internet).
There are also few packages which show what ideas others have about MVC, namespaces, PDO CRUD...
In my opinion it is bad (beginner), too complicated idea that each table has own CRUD class. Oracle Forms rejected such idea few dozen years ago, but PhpClasses best ranked MVC package makes science of scafolding - automatically generating each table own CRUD class, simmilar like Yii and other "best" PHP fw-s. What wonders me, they do not even mention other possibilities - bad praxis in many things, in many activities (because not explaine life is not worth living).
In my opinion it is bad (beginner), too complicated idea M, V, C folders for all modules-CRUD pages. Yes Oracle Forms has libraries but not used for this purpose (I in 23 years working in Oracle Forms did not used Oracle Forms libraries).
Ideas like PRE-CRUD code (in web programming called adapters) are explained complicated, mistificated, not simply explained like in B12phpfw.
Where best PHP frameworks have dozens megabytes of complicated code, B12phpfw has few kB of simple code.
It seems to me B12phpfw (my "Oracle Forms modules" way in PHP programming) is unique and best idea, and, at least, best for learning PHP.
A simple CRUD class. Requires very little code, but you can do stong customization usinng optional callbacks (lookups tables, format fields, radio button entry etc.) Allows master-detail pages, e.g. for invoices management
1. by Domenico Casaccia - 1 year ago (2021-02-20) Reply
2. by Marco Sillano Reply- 1 year ago (2021-06-16) in reply to comment 1 by Domenico Casaccia
Qualche problema? Che cosa non hai capito?
<h1>MySQLReflection</h1> <h2>A useful utility for the Object Relation Mapping of MySQL databases</h2> <p>This package can generate classes to access MySQL as objects.<br> <br> It can access a given MySQL database, retrieve its schema of tables and fields, and generates classes to access the records of tables as objects.<br> <br> The generate classes have setter and getter functions for accessing record field values, as well functions to insert, update and delete table records.</p>
<p>An auto generated MySQL class provides the following services:</p> <ul><li>A constructor for managing a fetched table?s row or for a adding a new one</li> <li>Management for both single or composite Primary Keys</li> <li>Automatic mapping of the different date formats may occurs between application and database</li> <li>Destructor to automatically close database connection</li> <li>Defines a set of attributes corresponding to the table fields</li> <li>Setter and Getter methods for each attribute</li> <li>OO methods for simplify DML select, insert, update and delete operations</li> <li>A facility for quickly updating a previously fetched row</li> <li>Useful methods to obtain table DDL and the last executed SQL statement</li> <li>Error handling of SQL statements</li> <li>Camel/Pascal case naming convention for Attributes/Class used for mapping Fields/Table</li> <li>Useful PHPDOC information about table, fields and the usage of class, attributes and methods</li> </ul> <p>Developers can quickly use these generated classes on their application.</p>
You can use Crudx php class. These following features are include with this class
I built this CRUD class. It reads your database and builds a library of classes that represent your database tables. A field class, data object class, and TableQuery class for each table will be built into a php file. It is designed this way to avoid using loops to generate queries for improved speed. I believe you will like what this class does once you use it. There is sample code on the class page.
This class can perform CRUD operations on MySQL table records.
It can perform several types of operations with records of a given MySQL table like:
The class can also generate HTML to display or update the table records like: