PHP
CSS/HTML
Javascript
Java
Gaming
Biking
Raspberry Pi
Programming
Other...
University

PHP

Quick Links


PHP MySQL Libary - MeekroDB

MeekroDB - The Simple PHP MySQL Library Include the class
<?php 
require_once 'inc/meekrodb.2.3.class.php';
DB::$user = 'username';
DB::$password = 'password';
DB::$dbName = 'database_name';
?>
Return one result
<?php 
$category = DB::queryFirstRow("SELECT * FROM `table` WHERE `row`=%s", $data);
?>
Return multiple results
<?php
$data = DB::query("SELECT * FROM `table`");

foreach($data as $d)
      {
        echo $d['row_name'];
      }
?>
Count results from last query
<?php echo DB::count();?>
Update records
<?php 
DB::update('table_name', array('field' => 'value', 'field2' => 'value2']), "row_id=%s", 'row_id');
?>
Insert Records
<?php DB::insert('table', array('row' => 'value','row2' => 'value2','row3' => 'value3'));?>
Get last record ID
<?php DB::insertId();?>

PHP BBCode - jBBCode

jBBCode Include the class & setup
<?php
require_once "inc/JBBCode/Parser.php";
$parser = new JBBCode\Parser();
$parser->addCodeDefinitionSet(new JBBCode\DefaultCodeDefinitionSet());
?>
Print out code
<?php
$parser->parse($content);
echo $parser->getAsHtml();
?>
Add your own BBCode (code tags are to be used with highlight.js).
<?php
$builder = new JBBCode\CodeDefinitionBuilder('code', '<pre><code>{param}</code></pre>');
$parser->addCodeDefinition($builder->build());
?>

Login | Contact Me | Our Friends - npwilson.com | Clockwork Loris | Copyright (©) 2018. Clive Tech.