CVS update: php3/tests
| From: | danny | Date: | Wed, 19 Aug 1998 18:46:16 +0000 |
| Subject: | CVS update: php3/tests | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-325@lists.php.net to get a copy of this message | ||
Date: Wednesday August 19, 1998 @ 14:46
Author: danny
Update of /repository/php3/tests
In directory asf:/tmp/cvs-serv27699/tests
Modified Files:
informix.php3
Log Message:
This will make BLOBs work with ODS 7.2
Index: php3/tests/informix.php3
diff -c php3/tests/informix.php3:1.2 php3/tests/informix.php3:1.3
*** php3/tests/informix.php3:1.2 Sun Aug 16 10:50:45 1998
--- php3/tests/informix.php3 Wed Aug 19 14:46:16 1998
***************
*** 21,43 ****
printf("| query : 'select * from orders' |\n");
printf("+----------------------------------------+\n");
$query = "select * from orders";
! $result = ifx_query($query, $res, "scroll");
! if (!check_ifx($res)) {
printf("ifx_query : %s:%s \n", ifx_error($res), ifx_errormsg());
}
! if (! $result) {
printf("ifx_query : bailing out \n");
die;
}
printf("+----------------------------------------+\n");
printf("| affected rows : |\n");
printf("+----------------------------------------+\n");
! printf("Estimated number of rows : %d\n\n", ifx_affected_rows($result));
printf("+----------------------------------------+\n");
printf("| Number of columns : |\n");
printf("+----------------------------------------+\n");
! printf("Number of columns = %d\n", ifx_num_fields($result));
printf("+----------------------------------------+\n");
printf("| field types and properties : |\n");
--- 21,43 ----
printf("| query : 'select * from orders' |\n");
printf("+----------------------------------------+\n");
$query = "select * from orders";
! $resultid = ifx_query($query, $res, "scroll");
! if (!check_ifx($resultid)) {
printf("ifx_query : %s:%s \n", ifx_error($res), ifx_errormsg());
}
! if (! $resultid) {
printf("ifx_query : bailing out \n");
die;
}
printf("+----------------------------------------+\n");
printf("| affected rows : |\n");
printf("+----------------------------------------+\n");
! printf("Estimated number of rows : %d\n\n", ifx_affected_rows($resultid));
printf("+----------------------------------------+\n");
printf("| Number of columns : |\n");
printf("+----------------------------------------+\n");
! printf("Number of columns = %d\n", ifx_num_fields($resultid));
printf("+----------------------------------------+\n");
printf("| field types and properties : |\n");
***************
*** 45,52 ****
unset($types);
unset($props);
! $types = ifx_fieldtypes($result);
! $props = ifx_fieldproperties($result);
if ((! isset($types)) || (! isset($props))) {
printf("ifx_fieldxxxx : %s\n", ifx_error($res));
ifx_close($res);
--- 45,52 ----
unset($types);
unset($props);
! $types = ifx_fieldtypes($resultid);
! $props = ifx_fieldproperties($resultid);
if ((! isset($types)) || (! isset($props))) {
printf("ifx_fieldxxxx : %s\n", ifx_error($res));
ifx_close($res);
***************
*** 61,104 ****
}
// the quick way :
! // ifx_htmltbl_result($result,"border=\"1\"");
// with more user control :
printf("+----------------------------------------+\n");
printf("| in normal order : |\n");
printf("+----------------------------------------+\n");
unset($row);
! $row = ifx_fetch_row($result, "first");
while (is_array($row)) {
for(reset($row); $fname = key($row); next($row)) {
printf("%s=%s;", $fname, $row[$fname]);
}
printf("\n");
! $row = ifx_fetch_row($result, "next");
}
printf("+----------------------------------------+\n");
printf("| and now in reverse order : |\n");
printf("+----------------------------------------+\n");
unset($row);
! $row = ifx_fetch_row($result, "last");
while (is_array($row)) {
for(reset($row); $fname = key($row); next($row)) {
printf("%s=%s;", $fname, $row[$fname]);
}
printf("\n");
! $row = ifx_fetch_row($result, "previous");
}
printf("+-----------------------------------------+\n");
printf("| and now row number 10 |\n");
printf("+-----------------------------------------+\n");
unset($row);
! $row = ifx_fetch_row($result, 10);
for(reset($row); $fname = key($row); next($row)) {
printf("%s=%s;", $fname, $row[$fname]);
}
! printf("\n\nResultid was : %d\n",$result);
! ifx_free_result($result);
printf("\n\n\n********* and now prepare/do test *******\n\n\n");
--- 61,104 ----
}
// the quick way :
! // ifx_htmltbl_resultid($resultid,"border=\"1\"");
// with more user control :
printf("+----------------------------------------+\n");
printf("| in normal order : |\n");
printf("+----------------------------------------+\n");
unset($row);
! $row = ifx_fetch_row($resultid, "first");
while (is_array($row)) {
for(reset($row); $fname = key($row); next($row)) {
printf("%s=%s;", $fname, $row[$fname]);
}
printf("\n");
! $row = ifx_fetch_row($resultid, "next");
}
printf("+----------------------------------------+\n");
printf("| and now in reverse order : |\n");
printf("+----------------------------------------+\n");
unset($row);
! $row = ifx_fetch_row($resultid, "last");
while (is_array($row)) {
for(reset($row); $fname = key($row); next($row)) {
printf("%s=%s;", $fname, $row[$fname]);
}
printf("\n");
! $row = ifx_fetch_row($resultid, "previous");
}
printf("+-----------------------------------------+\n");
printf("| and now row number 10 |\n");
printf("+-----------------------------------------+\n");
unset($row);
! $row = ifx_fetch_row($resultid, 10);
for(reset($row); $fname = key($row); next($row)) {
printf("%s=%s;", $fname, $row[$fname]);
}
! printf("\n\nResultid was : %d\n",$resultid);
! ifx_free_result($resultid);
printf("\n\n\n********* and now prepare/do test *******\n\n\n");
***************
*** 106,128 ****
printf("| prepare query : 'select * from orders' |\n");
printf("+----------------------------------------+\n");
$query = "select * from orders";
! $result = ifx_prepare($query, $res, "scroll");
! if (!check_ifx($res)) {
printf("ifx_prepare : %s:%s \n", ifx_error($res), ifx_errormsg());
}
! if (! $result) {
printf("ifx_prepare : bailing out \n");
die;
}
printf("+----------------------------------------+\n");
printf("| affected rows : |\n");
printf("+----------------------------------------+\n");
! printf("Estimated number of rows : %d\n\n", ifx_affected_rows($result));
printf("+----------------------------------------+\n");
printf("| Number of columns : |\n");
printf("+----------------------------------------+\n");
! printf("Number of columns = %d\n", ifx_num_fields($result));
printf("+----------------------------------------+\n");
printf("| field types and properties : |\n");
--- 106,128 ----
printf("| prepare query : 'select * from orders' |\n");
printf("+----------------------------------------+\n");
$query = "select * from orders";
! $resultid = ifx_prepare($query, $res, "scroll");
! if (!check_ifx($resultid)) {
printf("ifx_prepare : %s:%s \n", ifx_error($res), ifx_errormsg());
}
! if (! $resultid) {
printf("ifx_prepare : bailing out \n");
die;
}
printf("+----------------------------------------+\n");
printf("| affected rows : |\n");
printf("+----------------------------------------+\n");
! printf("Estimated number of rows : %d\n\n", ifx_affected_rows($resultid));
printf("+----------------------------------------+\n");
printf("| Number of columns : |\n");
printf("+----------------------------------------+\n");
! printf("Number of columns = %d\n", ifx_num_fields($resultid));
printf("+----------------------------------------+\n");
printf("| field types and properties : |\n");
***************
*** 130,137 ****
unset($types);
unset($props);
! $types = ifx_fieldtypes($result);
! $props = ifx_fieldproperties($result);
if ((! isset($types)) || (! isset($props))) {
printf("ifx_fieldxxxx : %s\n", ifx_error($res));
ifx_close($res);
--- 130,137 ----
unset($types);
unset($props);
! $types = ifx_fieldtypes($resultid);
! $props = ifx_fieldproperties($resultid);
if ((! isset($types)) || (! isset($props))) {
printf("ifx_fieldxxxx : %s\n", ifx_error($res));
ifx_close($res);
***************
*** 147,153 ****
printf("+----------------------------------------+\n");
printf("| execute query : 'select * from orders' |\n");
printf("+----------------------------------------+\n");
! if (! ifx_do($result)) {
printf("ifx_query : %s:%s \n", ifx_error($res), ifx_errormsg());
printf("ifx_do : bailing out\n");
die;
--- 147,153 ----
printf("+----------------------------------------+\n");
printf("| execute query : 'select * from orders' |\n");
printf("+----------------------------------------+\n");
! if (! ifx_do($resultid)) {
printf("ifx_query : %s:%s \n", ifx_error($res), ifx_errormsg());
printf("ifx_do : bailing out\n");
die;
***************
*** 155,244 ****
printf("+----------------------------------------+\n");
// the quick way :
! // ifx_htmltbl_result($result,"border=\"1\"");
// with more user control :
printf("+----------------------------------------+\n");
printf("| in normal order : |\n");
printf("+----------------------------------------+\n");
unset($row);
! $row = ifx_fetch_row($result, "first");
while (is_array($row)) {
for(reset($row); $fname = key($row); next($row)) {
printf("%s=%s;", $fname, $row[$fname]);
}
printf("\n");
! $row = ifx_fetch_row($result, "next");
}
printf("+----------------------------------------+\n");
printf("| and now in reverse order : |\n");
printf("+----------------------------------------+\n");
unset($row);
! $row = ifx_fetch_row($result, "last");
while (is_array($row)) {
for(reset($row); $fname = key($row); next($row)) {
printf("%s=%s;", $fname, $row[$fname]);
}
printf("\n");
! $row = ifx_fetch_row($result, "previous");
}
printf("+-----------------------------------------+\n");
printf("| and now row number 10 |\n");
printf("+-----------------------------------------+\n");
unset($row);
! $row = ifx_fetch_row($result, 10);
for(reset($row); $fname = key($row); next($row)) {
printf("%s=%s;", $fname, $row[$fname]);
}
printf("\n");
unset($row);
! printf("\n\nResultid was : %d\n",$result);
! ifx_free_result($result);
printf("\n");
printf("+-----------------------------------------+\n");
! printf("| some execute immediates |\n");
printf("+-----------------------------------------+\n");
$query = "create table testdh (k serial, d char(100), primary key (k))";
! $result = ifx_prepare($query, $res);
! if (!check_ifx($res)) {
printf("ifx_prepare : %s:%s \n", ifx_error($res), ifx_errormsg());
}
! if (! $result) {
printf("ifx_prepare : bailing out \n");
die;
}
printf("create table successfully prepared\n");
! if (! ifx_do($result)) {
printf("ifx_query : %s:%s \n", ifx_error($res), ifx_errormsg());
printf("ifx_do : bailing out\n");
die;
}
printf("create table successfully executed\n");
! ifx_free_result($result);
$query = "drop table testdh";
! $result = ifx_prepare($query, $res);
! if (!check_ifx($res)) {
printf("ifx_prepare : %s:%s \n", ifx_error($res), ifx_errormsg());
}
! if (! $result) {
printf("ifx_prepare : bailing out \n");
die;
}
printf("drop table successfully prepared\n");
! if (! ifx_do($result)) {
printf("ifx_query : %s:%s \n", ifx_error($res), ifx_errormsg());
printf("ifx_do : bailing out\n");
die;
}
printf("drop table successfully executed\n");
! ifx_free_result($result);
! ifx_close($res);
printf("+-----------------------------------------+\n");
printf("| -------- end --------- |\n");
printf("+-----------------------------------------+\n");
--- 155,305 ----
printf("+----------------------------------------+\n");
// the quick way :
! // ifx_htmltbl_resultid($resultid,"border=\"1\"");
// with more user control :
printf("+----------------------------------------+\n");
printf("| in normal order : |\n");
printf("+----------------------------------------+\n");
unset($row);
! $row = ifx_fetch_row($resultid, "first");
while (is_array($row)) {
for(reset($row); $fname = key($row); next($row)) {
printf("%s=%s;", $fname, $row[$fname]);
}
printf("\n");
! $row = ifx_fetch_row($resultid, "next");
}
printf("+----------------------------------------+\n");
printf("| and now in reverse order : |\n");
printf("+----------------------------------------+\n");
unset($row);
! $row = ifx_fetch_row($resultid, "last");
while (is_array($row)) {
for(reset($row); $fname = key($row); next($row)) {
printf("%s=%s;", $fname, $row[$fname]);
}
printf("\n");
! $row = ifx_fetch_row($resultid, "previous");
}
printf("+-----------------------------------------+\n");
printf("| and now row number 10 |\n");
printf("+-----------------------------------------+\n");
unset($row);
! $row = ifx_fetch_row($resultid, 10);
for(reset($row); $fname = key($row); next($row)) {
printf("%s=%s;", $fname, $row[$fname]);
}
printf("\n");
unset($row);
! printf("\n\nResultid was : %d\n",$resultid);
! ifx_free_result($resultid);
printf("\n");
printf("+-----------------------------------------+\n");
! printf("| some execute immediates(prepared) |\n");
printf("+-----------------------------------------+\n");
$query = "create table testdh (k serial, d char(100), primary key (k))";
! $resultid = ifx_prepare($query, $res);
! if (!check_ifx($resultid)) {
printf("ifx_prepare : %s:%s \n", ifx_error($res), ifx_errormsg());
}
! if (! $resultid) {
printf("ifx_prepare : bailing out \n");
die;
}
printf("create table successfully prepared\n");
! if (! ifx_do($resultid)) {
printf("ifx_query : %s:%s \n", ifx_error($res), ifx_errormsg());
printf("ifx_do : bailing out\n");
die;
}
printf("create table successfully executed\n");
! ifx_free_result($resultid);
! printf("\n");
! printf("+-----------------------------------------+\n");
! printf("| some inserts unprepared) |\n");
! printf("+-----------------------------------------+\n");
!
! for ($i = 1; $i < 20; $i++) {
! $query = sprintf(
! "insert into testdh values (0,\"- this is row number %d
-\")",
! $i);
! echo $query . "\n";
! $rc = ifx_query($query, $res);
! if (! $rc) {
! printf("insert fails : %s:%s\n", ifx_error($res), ifx_errormsg());
! die;
! }
! ifx_free_result($rc);
! }
+ printf("\n");
+ printf("+-----------------------------------------+\n");
+ printf("| deleting inserted rows |\n");
+ printf("+-----------------------------------------+\n");
+ $query = "delete from testdh";
+ $resultid = ifx_prepare($query, $res);
+ if (!check_ifx($resultid)) {
+ printf("ifx_prepare : %s:%s \n", ifx_error($res), ifx_errormsg());
+ }
+ printf("estimate : %d rows will be deleted\n", ifx_affected_rows($resultid));
+ if (!ifx_do($resultid)) {
+ printf("ifx_do : %s:%s \n", ifx_error($res), ifx_errormsg());
+ die;
+ }
+ printf("%d rows successfully deleted\n", ifx_affected_rows($resultid));
+
$query = "drop table testdh";
! $resultid = ifx_prepare($query, $res);
! if (!check_ifx($resultid)) {
printf("ifx_prepare : %s:%s \n", ifx_error($res), ifx_errormsg());
+ die;
}
! if (! $resultid) {
printf("ifx_prepare : bailing out \n");
die;
}
printf("drop table successfully prepared\n");
! if (! ifx_do($resultid)) {
printf("ifx_query : %s:%s \n", ifx_error($res), ifx_errormsg());
printf("ifx_do : bailing out\n");
die;
}
printf("drop table successfully executed\n");
! ifx_free_result($resultid);
! printf("\n");
! printf("+-----------------------------------------+\n");
! printf("| some execute immediates(unprepared)|\n");
! printf("+-----------------------------------------+\n");
! $query = "create table testdh (k serial, d char(100), primary key (k))";
! $resultid = ifx_query($query, $res);
! if (!check_ifx($resultid)) {
! printf("ifx_query : %s:%s \n", ifx_error($res), ifx_errormsg());
! }
! if (! $resultid) {
! printf("ifx_query : bailing out \n");
! die;
! }
! printf("create table successfully executed\n");
! ifx_free_result($resultid);
+ $query = "drop table testdh";
+ $resultid = ifx_query($query, $res);
+ if (!check_ifx($resultid)) {
+ printf("ifx_query : %s:%s \n", ifx_error($res), ifx_errormsg());
+ }
+ if (! $resultid) {
+ printf("ifx_query : bailing out \n");
+ die;
+ }
+ printf("drop table successfully executed\n");
+ ifx_free_result($resultid);
+
+ ifx_close($res);
printf("+-----------------------------------------+\n");
printf("| -------- end --------- |\n");
printf("+-----------------------------------------+\n");
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net