PHP Classes

File: test.mysql_query.php

Recommend this page to a friend!
  Classes of Niels Scheffers   mysql_query   test.mysql_query.php   Download  
File: test.mysql_query.php
Role: Unit test script
Content type: text/plain
Description: Testing/Example script
Class: mysql_query
Creates your mysql queries
Author: By
Last change:
Date: 20 years ago
Size: 1,151 bytes


Class file image Download
 * ALTS - Another Little Testing Script
 * Bla bla bla... I never know what to write here...

$my = new mysql_query("insert", "SELECT * FROM FooBar WHERE Foo = 'Bar'", "");
// Generate my queries from a select-statement please... Oh, and make it an insert-query... thanks.
$my->setKey("Foo1", "1"); // <-- to demonstrate the difference in handling numeric/alphanumeric values :)
$my->setKey("Foo2", "Bar2");
// These are the values I'd like to insert.
// Generate me a query then. C'mon, show me your power..
echo $my->query;
// Wow, thanks...
echo "<br>"; // There should be a PHP command br(); which does this :)

$my->type = "update";
// Let's see how you handle an update-query then?
// Hey, that's right, you already know what to do so nothing else needs to be inserted...
echo $my->query;
// Cool... thanks again...

echo "<br>";

$my->type = "delete";
// But can you do a delete?
// Guess so...
echo $my->query;
// Yeah yeah, I'll just take you for granted now thank you.