Skip to content

Tools useful for real world PHP projects, such as a nice MySQL API and Unicode precomposer / NFC normalizer.

Notifications You must be signed in to change notification settings

johannesl/RealWorldPHP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

easiermysql.php

$mysql_username = 'username';
$mysql_password = 'password';
$mysql_database = 'database';

mConnect();

Simple inserts

$insert = array(
  'articleid' => 1234,
  'author' => 567,
  '@created', 'now()',
  'text' => 'Great advice! This will be a perfect match for my Raspberry Pi!'
);
mInsert('comments',$insert);

Easy updates

$update = array(
  'id' => '1234',
  '@likes' => 'likes+1'
);
mUpdate('articles','id',$update);

Safe queries

$articles = mSelectRows(
  'SELECT * FROM articles '.
  'WHERE category=@ AND author=@ ORDER BY created DESC',
  array($_GET['category'],$_GET['author'])
);

About

Tools useful for real world PHP projects, such as a nice MySQL API and Unicode precomposer / NFC normalizer.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages