logo       
Google Custom Search
    AddThis Social Bookmark Button

cvs: pecl /maxdb/tests maxdb_long_update.phpt: msg#00207

Subject: cvs: pecl /maxdb/tests maxdb_long_update.phpt
simenec         Wed Oct 26 11:25:25 2005 EDT

  Added files:                 
    /pecl/maxdb/tests   maxdb_long_update.phpt 
  Log:
  add test program
  

http://cvs.php.net/co.php/pecl/maxdb/tests/maxdb_long_update.phpt?r=1.1&p=1
Index: pecl/maxdb/tests/maxdb_long_update.phpt
+++ pecl/maxdb/tests/maxdb_long_update.phpt
--TEST--
maxdb long update err
--SKIPIF--
<?php require 'skipif.inc'; ?>
--FILE--
<?php
include "connect.inc";

/*** test maxdb_connect 127.0.0.1 ***/
$link = maxdb_connect("localhost", $user, $passwd);

maxdb_select_db($link, $db);

maxdb_report (MAXDB_REPORT_OFF);
maxdb_query($link,"DROP TABLE test_bind_fetch");
maxdb_report (MAXDB_REPORT_ERROR);

maxdb_query($link,"CREATE TABLE test_bind_fetch(c int, l long ascii)");

$stmt = maxdb_prepare ($link, "INSERT INTO test_bind_fetch VALUES (?,?)");
maxdb_bind_param($stmt, "ib", $c1, $c2);

$c1 = 1;

maxdb_send_long_data($stmt, 1, "This is the first sentence.");
maxdb_send_long_data($stmt, 1, " And this is the second sentence.");
maxdb_send_long_data($stmt, 1, " And finally this is the last sentence.");

maxdb_execute($stmt);
maxdb_stmt_close($stmt);

$result = maxdb_query($link, "SELECT * FROM test_bind_fetch");
$row = maxdb_fetch_row($result);
printf ("%s\n", $row[1]);
maxdb_stmt_close($stmt);

$stmt = maxdb_prepare ($link, "UPDATE test_bind_fetch SET l = ? WHERE c = ?");
maxdb_bind_param($stmt, "bi", $c2, $c1);

maxdb_send_long_data($stmt, 0, "xxxxxx");

maxdb_execute($stmt);
maxdb_stmt_close($stmt);

$result = maxdb_query($link, "SELECT * FROM test_bind_fetch");
$row = maxdb_fetch_row($result);
printf ("%s\n", $row[1]);
maxdb_stmt_close($stmt);
maxdb_free_result($result);

maxdb_close($link);
?>
--EXPECT--
This is the first sentence. And this is the second sentence. And finally this 
is the last sentence.
xxxxxx




Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>