Skip to content

pavanksd/php_oop_curd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php oop curd

A simple PHP Class for using with MySQL create, read, update and delete functions.

  • To Run this example directly in PHP server
    • php -S localhost:<port_number>
    • Page entry point -: localhost:<port_number>/app

Config
You will need to change some variable values in the Database class

private $servername = "<your_db_url>";
private $db_name = "<your_db_name>";
private $username = "<your_username>";
private $password = "<your_db_name>";
CREATE TABLE `tasks` (
  `id` int NOT NULL,
  `name` varchar(32) NOT NULL,
  `description` text NOT NULL,
  `priority_id` int NOT NULL,
  `created` datetime NOT NULL,
  `modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `priorities` (
  `id` int NOT NULL,
  `priority` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

//samlple priority
INSERT INTO `priorities` (`id`, `priority`) VALUES (NULL, 'Low'), (NULL, 'Medium'), (NULL, 'High') 

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages