Skip to content

Instantly share code, notes, and snippets.

View avinashseth's full-sized avatar
🎯
Focusing

Avinash Seth avinashseth

🎯
Focusing
  • Self Employed
  • India
View GitHub Profile
<div class="col-lg-12 col-md-12">
</div>
<form action="register.php" method="get">
<input type="text" name="username" />
<button>Login</button>
</form>
INSERT INTO `table_name`(`id`, `column_one`, `column_two`) VALUES (1,'value for column_one','value for column_two')
-- 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";
-- 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";
<?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',
<?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]
<?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) {
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))
{