#35793 [Fbk->Opn]: General error: 2050

From: Date: Tue, 27 Dec 2005 10:29:28 +0000
Subject: #35793 [Fbk->Opn]: General error: 2050
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-91111@lists.php.net to get a copy of this message
 ID:               35793
 User updated by:  deadman_great at mail dot ru
 Reported By:      deadman_great at mail dot ru
-Status:           Feedback
+Status:           Open
 Bug Type:         PDO related
 Operating System: RH Fedora Core 2
 PHP Version:      5CVS-2005-12-25 (snap)
 New Comment:

Installed latest mysql (v5.0.17). Same error.


Previous Comments:
------------------------------------------------------------------------

[2005-12-26 23:22:21] wez@php.net

Almost certainly a mysql bug.  Check in with the mysql bug database.

------------------------------------------------------------------------

[2005-12-26 17:06:35] sniper@php.net

Assigned to the PDO maintainer.

------------------------------------------------------------------------

[2005-12-25 19:21:12] deadman_great at mail dot ru

Tried php5.1-200512251730, - same result.

------------------------------------------------------------------------

[2005-12-25 17:37:56] sniper@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip



------------------------------------------------------------------------

[2005-12-24 18:30:13] deadman_great at mail dot ru

OK, without OO:

<?

$pdo = new PDO('mysql:host=localhost;dbname=mydb','login','pass');
$pdo->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_WARNING);
	
function Query ()
{
	global $pdo;

	$query = 'SELECT created, to_days(from_unixtime(created)) as
day,count(id) as count '.
	'FROM orders '.
	'WHERE partner=:partner '.
	'AND created>=:date '.
	'GROUP BY day';

	$vars = array(':partner'=>9,':date'=>1132797644);

	$stm = $pdo->Prepare($query);
	$stm->Execute($vars);
	return $stm;
}

$result = Query();
foreach ($result as $day)
{
	print_r($day); echo '<hr>';
}

$result = Query();
foreach ($result as $day)
{
	print_r($day); echo '<hr>';
}

$result = Query();
foreach ($result as $day)
{
	print_r($day); echo '<hr>';
}


?>

SQL:

CREATE TABLE orders (
  id int(10) unsigned NOT NULL auto_increment,
  state tinyint(3) unsigned NOT NULL default '0',
  partner int(10) unsigned NOT NULL,
  created int(10) unsigned NOT NULL default '0',
  completed int(10) unsigned default NULL,
  count tinyint(3) unsigned NOT NULL,
  cost float(11,2) unsigned NOT NULL default '0.00',
  zip int(10) unsigned default NULL,
  region varchar(80) default NULL,
  city varchar(120) default NULL,
  street varchar(255) default NULL,
  house varchar(32) default NULL,
  building varchar(32) default NULL,
  apartment varchar(32) default NULL,
  name varchar(255) default NULL,
  surname varchar(255) default NULL,
  patronymic varchar(255) default NULL,
  mail varchar(120) default NULL,
  comments text,
  PRIMARY KEY  (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

INSERT INTO orders VALUES
(1,0,9,1134531133,1134931138,2,20,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO orders VALUES
(2,4,9,1134911133,1134911139,1,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO orders VALUES
(3,1,9,1134811133,1134811137,4,40,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO orders VALUES
(4,3,9,1134711133,1134711533,1,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO orders VALUES
(5,4,9,1134511131,1134511138,1,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO orders VALUES
(6,1,0,1135521534,NULL,1,10,121231,'test','test','test','12',NULL,NULL,'test','test','test','one@test.com',NULL);
INSERT INTO orders VALUES
(7,0,9,1134522614,NULL,1,10,354354,'test2','test2','test2','12',NULL,NULL,'test2','test2','test2','two@test.com',NULL);

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/35793

-- 
Edit this bug report at http://bugs.php.net/?id=35793&edit=1


Thread (43 messages)

« previous php.bugs (#91111) next »