Location: PHPKode > projects > PHP debug tools > php-debug-tools/test4-mysql.php
<?php
include_once './auto_prepend.php';

include './lib/db-mysql.php';
db_connect(array(
	'host' => 'localhost',
	'user' => 'root',
	'pass' => 'toor',
	'dbname' => 'test',
	'charset' => 'latin2'
));
db_query('CREATE TABLE IF NOT EXISTS testdebug (id int PRIMARY KEY)');
db_query('DELETE FROM testdebug WHERE 1=1');
db_insert('testdebug', array('id'=>1));
db_insert('testdebug', array('id'=>2));
db_insert('testdebug', array('id'=>3));
$id1 = db_one('SELECT id FROM testdebug WHERE id = %id', array('id'=>1));
$row_id2 = db_row('SELECT * FROM testdebug WHERE id = %0', array(1));
$assoc = db_assoc('SELECT id, id FROM testdebug ORDER BY id');

include_once './auto_append.php';
?>
Return current item: PHP debug tools