Esempio n. 1
0
<?php

# +----------------------------------------------------------------------+
# | TurboPhp 4 - TpMySql
# | Version 4.0 Beta                                                     |
# +----------------------------------------------------------------------+
# | Copyright (c) 2004 Least-Resistance Software                         |
# +----------------------------------------------------------------------+
# | This source file is subject to the terms of the TurboPhp license,    |
# | that is bundled with this package in the file LICENSE.TXT, and is    |
# | available at through the world-wide-web at                           |
# | http://www.turbophp.com/turbophp/license.txt                         |
# +----------------------------------------------------------------------+
include_once 'TpDb.php';
TpRegisterClass('mysql', 'TTpMySql');
TpRegisterClass('mysqlquery', 'TTpMySqlQuery');
function TpMySqlResultsToArray(&$inResults)
{
    $rows = array();
    while ($row = mysql_fetch_row($inResults)) {
        $rows[] = $row[0];
    }
    return $rows;
}
class TTpMySql extends TTpDbConnect
{
    function DoConnect()
    {
        if ($this->Persistent) {
            $connect = 'mysql_pconnect';
        } else {
Esempio n. 2
0
 function RegisterClasses()
 {
     TpRegisterClass('default', 'TTpObj');
     TpRegisterClass('label', 'TTpObj');
     TpRegisterClass('form', 'TTpForm');
     TpRegisterClass('button', 'TTpButton');
     TpRegisterClass('input', 'TTpInput');
     TpRegisterClass('textarea', 'TTpTextArea');
     TpRegisterClass('checkbox', 'TTpCheckBox');
     TpRegisterClass('radio', 'TTpRadio');
     TpRegisterClass('repeater', 'TTpRepeater');
     TpRegisterClass('table', 'TTpTable');
     TpRegisterClass('select', 'TTpSelect');
     TpRegisterClass('ttpwebvar', 'TTpWebVariable');
 }
Esempio n. 3
0
# +----------------------------------------------------------------------+
# | TurboPhp 4 - TpDb
# | Version 4.0 Beta                                                     |
# +----------------------------------------------------------------------+
# | Copyright (c) 2004 Least-Resistance Software                         |
# +----------------------------------------------------------------------+
# | This source file is subject to the terms of the TurboPhp license,    |
# | that is bundled with this package in the file LICENSE.TXT, and is    |
# | available at through the world-wide-web at                           |
# | http://www.turbophp.com/turbophp/license.txt                         |
# +----------------------------------------------------------------------+
TpRegisterClass('dbtext', 'TTpDbText');
TpRegisterClass('dbedit', 'TTpDbEdit');
TpRegisterClass('dbtextarea', 'TTpDbTextArea');
TpRegisterClass('dblistsource', 'TTpDbListSource');
define('P_QUERY_PARAM', '#{%([^}]*)}#Usm');
class TTpDbConnect extends TTpSilentObj
{
    var $ConfigFile;
    var $Connection;
    var $ConnectManually;
    var $Database;
    var $Host;
    var $OnConnect;
    var $Password;
    var $Persistent;
    var $UserName;
    function Init()
    {
        parent::Init();