ret = FAILURE;
obj = (mysqli_object *)zend_objects_get_address(object TSRMLS_CC);
- if (!obj->valid) {
- retval = EG(uninitialized_zval_ptr);
- return(retval);
- }
-
if (member->type != IS_STRING) {
tmp_member = *member;
zval_copy_ctor(&tmp_member);
if (obj->prop_handler != NULL) {
ret = zend_hash_find(obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd);
}
+
if (ret == SUCCESS) {
/* check if mysqli object is still valid */
} else {
std_hnd = zend_get_std_object_handlers();
retval = std_hnd->read_property(object, member, type TSRMLS_CC);
+ retval->refcount = 1;
}
if (member == &tmp_member) {
#include "ext/standard/info.h"
#include "php_mysqli.h"
+#define CHECK_OBJECT() \
+ if (!obj->valid) { \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Property access is not allowed yet. Call the default constructor of the object first"); \
+ ZVAL_NULL(*retval); \
+ return SUCCESS; \
+ } \
+
#define MYSQLI_GET_MYSQL() \
MYSQL *p = (MYSQL *)((MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr)->mysql;
#define MYSQLI_MAP_PROPERTY_FUNC_LONG( __func, __int_func, __get_type, __ret_type)\
int __func(mysqli_object *obj, zval **retval TSRMLS_DC) \
{\
+ ALLOC_ZVAL(*retval); \
+ CHECK_OBJECT(); \
__ret_type l;\
__get_type;\
- ALLOC_ZVAL(*retval);\
if (!p) {\
ZVAL_NULL(*retval);\
} else {\
int __func(mysqli_object *obj, zval **retval TSRMLS_DC)\
{\
char *c;\
+ ALLOC_ZVAL(*retval); \
+ CHECK_OBJECT(); \
__get_type;\
- ALLOC_ZVAL(*retval);\
if (!p) {\
ZVAL_NULL(*retval);\
} else {\
return SUCCESS;
}
/* }}} */
-/* {{{ property link_test_read */
-int link_test_read(mysqli_object *obj, zval **retval TSRMLS_DC)
-{
- long i;
- ALLOC_ZVAL(*retval);
- array_init(*retval);
-
- for (i=0; i < 10; i++)
- add_index_long(*retval, i, i + 10);
- return SUCCESS;
-}
-/*i }}} */
/* {{{ property link_connect_errno_read */
int link_connect_errno_read(mysqli_object *obj, zval **retval TSRMLS_DC)
/* {{{ property result_type_read */
int result_type_read(mysqli_object *obj, zval **retval TSRMLS_DC)
{
+ ALLOC_ZVAL(*retval);
+ CHECK_OBJECT();
+
MYSQL_RES *p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
- ALLOC_ZVAL(*retval);
if (!p) {
ZVAL_NULL(*retval);
} else {
/* {{{ property result_lengths_read */
int result_lengths_read(mysqli_object *obj, zval **retval TSRMLS_DC)
{
+ ALLOC_ZVAL(*retval);
+ CHECK_OBJECT();
+
MYSQL_RES *p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
- ALLOC_ZVAL(*retval);
if (!p || !p->field_count) {
ZVAL_NULL(*retval);
} else {
{"affected_rows", link_affected_rows_read, NULL},
{"client_info", link_client_info_read, NULL},
{"client_version", link_client_version_read, NULL},
- {"test", link_test_read, NULL},
{"connect_errno", link_connect_errno_read, NULL},
{"connect_error", link_connect_error_read, NULL},
{"errno", link_errno_read, NULL},
mysqli connect
--FILE--
<?php
+ include "connect.inc";
- $user = "root";
- $passwd = "";
$dbname = "test";
$test = "";
- /*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("127.0.0.1", $user, $passwd);
- $test .= ($link) ? "1" : "0";
- mysqli_close($link);
-
- /*** test mysqli_connect localhost ***/
- $link = mysqli_connect("localhost", $user, $passwd);
- $test .= ($link) ? "1" : "0";
- mysqli_close($link);
-
/*** test mysqli_connect localhost:port ***/
- $link = mysqli_connect("localhost", $user, $passwd, "", 3306);
+ $link = mysqli_connect($host, $user, $passwd, "", 3306);
$test .= ($link) ? "1" : "0";
mysqli_close($link);
/*** test mysqli_real_connect ***/
$link = mysqli_init();
- $test.= (mysqli_real_connect($link, "localhost", $user, $passwd))
+ $test.= (mysqli_real_connect($link, $host, $user, $passwd))
? "1" : "0";
mysqli_close($link);
/*** test mysqli_real_connect with db ***/
$link = mysqli_init();
- $test .= (mysqli_real_connect($link, "localhost", $user, $passwd, $dbname))
+ $test .= (mysqli_real_connect($link, $host, $user, $passwd, $dbname))
? "1" : "0";
mysqli_close($link);
/*** test mysqli_real_connect with port ***/
$link = mysqli_init();
- $test .= (mysqli_real_connect($link, "localhost", $user, $passwd, $dbname, 3306))
+ $test .= (mysqli_real_connect($link, $host, $user, $passwd, $dbname, 3306))
? "1":"0";
mysqli_close($link);
/*** test mysqli_real_connect compressed ***/
$link = mysqli_init();
- $test .= (mysqli_real_connect($link, "localhost", $user, $passwd, $dbname, 0, NULL, MYSQLI_CLIENT_COMPRESS))
+ $test .= (mysqli_real_connect($link, $host, $user, $passwd, $dbname, 0, NULL, MYSQLI_CLIENT_COMPRESS))
? "1" : "0";
mysqli_close($link);
var_dump($test);
?>
--EXPECT--
-string(7) "1111111"
+string(5) "11111"
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
$rc = mysqli_query($link,"DROP TABLE IF EXISTS test_fetch_null");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include ("connect.inc");
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
--SKIPIF--
<?php
include "connect.inc";
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$result = mysqli_query($link, "SHOW VARIABLES LIKE 'have_innodb'");
$row = mysqli_fetch_row($result);
mysqli_free_result($result);
--FILE--
<?php
include "connect.inc";
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
--SKIPIF--
<?php
include "connect.inc";
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$result = mysqli_query($link, "SHOW VARIABLES LIKE 'have_innodb'");
$row = mysqli_fetch_row($result);
mysqli_free_result($result);
<?php
include "connect.inc";
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
mysqli_execute($stmt);
mysqli_fetch($stmt);
-// mysqli_stmt_close($stmt);
+ mysqli_stmt_close($stmt);
+
+ $c0 = ($c0 == $user . "@" . $host) ? 1 : 0;
$test = array($c0, $c1, $c2);
--EXPECT--
array(3) {
[0]=>
- string(14) "root@localhost"
+ int(1)
[1]=>
string(4) "test"
[2]=>
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
$rc = mysqli_query($link,"DROP TABLE IF EXISTS insert_read");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
mysqli bind_param/bind_result with send_long_data
--FILE--
<?php
- $user = "root";
- $passwd = "";
-
+ include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
function test: mysqli_stat
--FILE--
<?php
- $user = "root";
- $passwd = "";
-
+ include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$status = mysqli_stat($link);
function test: mysqli_character_set_name
--FILE--
<?php
- $user = "root";
- $passwd = "";
-
+ include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$cset = substr(mysqli_character_set_name($link),0,6);
function test: mysqli_affected_rows
--FILE--
<?php
- $user = "root";
- $passwd = "";
-
+ include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
function test: mysqli_errno
--FILE--
<?php
- $user = "root";
- $passwd = "";
+ include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$errno = mysqli_errno($link);
var_dump($errno);
function test: mysqli_error
--FILE--
<?php
- $user = "root";
- $passwd = "";
+ include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$error = mysqli_error($link);
var_dump($error);
function test: mysqli_info
--FILE--
<?php
- $user = "root";
- $passwd = "";
-
+ include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
function test: mysqli_get_host_info
--FILE--
<?php
- $user = "root";
- $passwd = "";
-
+ include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$hinfo = mysqli_get_host_info($link);
function test: mysqli_get_proto_info
--FILE--
<?php
- $user = "root";
- $passwd = "";
-
+ include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$pinfo = mysqli_get_proto_info($link);
function test: mysqli_get_server_info
--FILE--
<?php
- $user = "root";
- $passwd = "";
-
+ include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$sinfo = substr(mysqli_get_server_info($link),0,1);
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_real_query($link, "SHOW VARIABLES");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$i = mysqli_get_server_version($link);
--SKIPIF--
<?php
include "connect.inc";
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
mysqli_execute($stmt);
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $mysql = mysqli_connect("localhost", $user, $passwd);
+ $mysql = mysqli_connect($host, $user, $passwd);
$mysql->select_db("test");
$mysql->query("DROP TABLE IF EXISTS test_fetch_null");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $mysql = mysqli_connect("localhost", $user, $passwd);
+ $mysql = mysqli_connect($host, $user, $passwd);
$mysql->select_db("test");
$result = $mysql->query("SELECT CURRENT_USER()");
$row = $result->fetch_row();
$result->close();
-
- var_dump($row);
+
+ $ok = ($row[0] == $user . "@" . $host);
+ var_dump($ok);
$mysql->close();
?>
--EXPECT--
-array(1) {
- [0]=>
- string(14) "root@localhost"
-}
+bool(true)
/************************
* non freed stamement
************************/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$stmt = mysqli_prepare($link, "SELECT CURRENT_USER()");
mysqli_execute($stmt);
/************************
* free statement after close
************************/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$stmt1 = mysqli_prepare($link, "SELECT CURRENT_USER()");
mysqli_execute($stmt1);
/************************
* statement call after close
************************/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$stmt2 = mysqli_prepare($link, "SELECT CURRENT_USER()");
/************************
* non freed resultset
************************/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$result = mysqli_query($link, "SELECT CURRENT_USER()");
mysqli_close($link);
/************************
* free resultset after close
************************/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$result1 = mysqli_query($link, "SELECT CURRENT_USER()");
mysqli_close($link);
/************************
* don't free anything
************************/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
$result2 = mysqli_query($link, "SELECT CURRENT_USER()");
$stmt2 = mysqli_prepare($link, "SELECT CURRENT_USER()");
}
$foo = new foobar();
- $foo->connect("localhost", $user, $passwd);
+ $foo->connect($host, $user, $passwd);
$foo->close();
printf("%s\n", $foo->test());
?>
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
include "connect.inc";
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
}
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, "test");
}
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect("localhost", $user, $passwd, "test");
+ $link = mysqli_connect($host, $user, $passwd, "test");
/* create temporary file */
$fp = fopen("061.csv", "w");
--- /dev/null
+--TEST--
+Bug #28817 testcase (properties)
+--FILE--
+<?php
+ include "connect.inc";
+
+ class my_mysql extends mysqli {
+ public $p_test;
+
+ function __construct() {
+ $this->p_test[] = "foo";
+ $this->p_test[] = "bar";
+ }
+ }
+
+
+ $mysql = new my_mysql();
+
+ var_dump($mysql->p_test);
+ @var_dump($mysql->errno);
+
+ $mysql->connect($host, $user, $passwd);
+ $mysql->select_db("nonexistingdb");
+
+ var_dump($mysql->errno > 0);
+
+ $mysql->close();
+?>
+--EXPECTF--
+array(2) {
+ [0]=>
+ string(3) "foo"
+ [1]=>
+ string(3) "bar"
+}
+NULL
+bool(true)
/* class 1 calls parent constructor */
class mysql1 extends mysqli {
function __construct() {
- parent::__construct("localhost", "root", "", "test");
+ global $host, $user, $passwd;
+ parent::__construct($host, $user, $passwd, "test");
}
}
class mysql2 extends mysqli {
function __construct() {
- $this->connect("localhost", "root", "", "test");
+ global $host, $user, $passwd;
+ $this->connect($host, $user, $passwd, "test");
}
}
$foo[0] = new mysql1();
$foo[1] = new mysql2();
- $foo[2] = new mysql3("localhost", "root", "", "test");
+ $foo[2] = new mysql3($host, $user, $passwd, "test");
for ($i=0; $i < 3; $i++) {
class mysql2 extends mysql1 {
}
- $mysql = new mysql2("localhost", "root", "", "test");
+ $mysql = new mysql2($host, "root", "", "test");
$mysql->query("THIS DOES NOT WORK");
printf("%d\n", $mysql->errno);