Back to index

php5  5.3.10
Classes | Enumerations | Functions
test.inc File Reference

Go to the source code of this file.

Classes

class  sybase

Enumerations

enum  HOST
enum  USER
enum  PASSWORD
enum  TEMPDB

Functions

 sybase_msg_handler ($msgnumber, $severity, $state, $line, $text)
 sybase_set_messagehandler_ex ($handler)
 sybase_connect_ex ($charset=NULL, $appname=NULL, $new=FALSE)
 sybase_select_ex ($dbh, $query)
 sybase_select_single ($dbh, $query)

Enumeration Type Documentation

enum HOST

Definition at line 8 of file test.inc.

enum PASSWORD

Definition at line 10 of file test.inc.

enum TEMPDB

Definition at line 11 of file test.inc.

enum USER

Definition at line 9 of file test.inc.


Function Documentation

sybase_connect_ex ( charset = NULL,
appname = NULL,
new = FALSE 
)

Definition at line 54 of file test.inc.

                                                                          {
    sybase_min_server_severity(11);       // Suppress "changed database context"
    if (!($db= sybase_connect(HOST, USER, PASSWORD, $charset ? $charset : 'iso_1', $appname, $new))) {
      die('Connect to '.USER.'@'.HOST.' failed (using password: '.(PASSWORD ? 'yes' : 'no').')');
    }
    return $db;
  }
sybase_msg_handler ( msgnumber,
severity,
state,
line,
text 
)

Definition at line 15 of file test.inc.

                                                                           {
    printf(
      "*** Caught Sybase Server Message #%d [Severity %d, state %d] at line %d\n    '%s'\n",
      $msgnumber,
      $severity,
      $state,
      $line,
      chop($text)
    );
  }

Here is the caller graph for this function:

sybase_select_ex ( dbh,
query 
)

Definition at line 65 of file test.inc.

                                          {
    printf(">>> Query: %s\n", $query);
    $h= sybase_query($query, $dbh);
    printf("<<< Return: %s\n", gettype($h));
    flush();
    if (!is_resource($h)) return $h;

    $return= array();
    while ($row= sybase_fetch_assoc($h)) {
      $return[]= $row;
    }
    return $return;
  }
sybase_select_single ( dbh,
query 
)

Definition at line 81 of file test.inc.

                                              {
    $a = sybase_fetch_row(sybase_query($query, $dbh));
    return array_shift($a);
  }

Definition at line 48 of file test.inc.

                                                  {
    var_dump(sybase_set_message_handler($handler));
  }