A Pen by Avinash Seth on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="col-lg-12 col-md-12"> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <form action="register.php" method="get"> | |
| <input type="text" name="username" /> | |
| <button>Login</button> | |
| </form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| INSERT INTO `table_name`(`id`, `column_one`, `column_two`) VALUES (1,'value for column_one','value for column_two') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- phpMyAdmin SQL Dump | |
| -- version 4.1.6 | |
| -- http://www.phpmyadmin.net | |
| -- | |
| -- Host: 127.0.0.1 | |
| -- Generation Time: Jun 22, 2016 at 08:33 AM | |
| -- Server version: 5.6.16 | |
| -- PHP Version: 5.5.9 | |
| SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- phpMyAdmin SQL Dump | |
| -- version 4.1.6 | |
| -- http://www.phpmyadmin.net | |
| -- | |
| -- Host: 127.0.0.1 | |
| -- Generation Time: Jun 22, 2016 at 08:34 AM | |
| -- Server version: 5.6.16 | |
| -- PHP Version: 5.5.9 | |
| SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| require 'vendor/autoload.php'; | |
| $database = new medoo([ | |
| // required | |
| 'database_type' => 'mysql', | |
| 'database_name' => 'name', | |
| 'server' => 'localhost', | |
| 'username' => 'your_username', | |
| 'password' => 'your_password', | |
| 'charset' => 'utf8', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $database->insert("account", [ | |
| "user_name" => "foo", | |
| "email" => "[email protected]" | |
| ]); | |
| /* note */ | |
| /* | |
| * account is the table name | |
| * user_name is the column name and value is foo | |
| * email is the column name and value is [email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function is_unique | |
| ( | |
| $db = null | |
| ) | |
| { | |
| // this statement means please count, and tell me how many students have rollnumber = 1022 | |
| $count = $db->count("students",["student_rollnumber"=>"1022"]); | |
| // if count == 0 means no student has rollnumber 1022 | |
| if($count == 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function generate_unique_key | |
| ( | |
| $column_name = null, | |
| $db = null, | |
| $table_name = null, | |
| $size = null | |
| ) | |
| { | |
| if(is_null($size) || is_null($column_name) || is_null($table_name) || is_null($db)) | |
| { |
OlderNewer