For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > March 2005 > [PEAR]DB Error: mismatch









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author [PEAR]DB Error: mismatch
J Fainer

2005-03-28, 3:57 pm

Does someone know the answer to this puzzle?

The attached code snippet was developed and tested on a SUSE 9.1 install
and works without any issues. But on the production server, a Sunfire
V100 running Solaris 9.0, apache2, mysql 4.0.24 and PHP 5.0.3; all other
code including successful queries of the database work fine, but when
the program attempts to update or create new data the system issues a DB
Error: mismatch. If I do a direct query to the database, I can edit all
day. I also changed the error reporting to use mysql_error() and
mysql_errnum() and it returns "0". I have since reinstalled mysql and
recompiled PHP without any luck. Because I get a DB:error and no mysql
error is there a chance there is a PEAR issue? Any ideas?

snippet:
_______________________________________

$sql = $db->prepare("UPDATE cutsheet
SET cutsheet.StationQuad = '$StationQuad',
cutsheet.StationPort = '$StationPort',
cutsheet.SSSystemName = '$SSSystemName',
cutsheet.SSIPAddress = '$SSIPAddress',
cutsheet.SStackSwitch = '$SStackSwitch',
cutsheet.SSSwitchPort = '$SSSwitchPort',
cutsheet.PortSpeed = '$PortSpeed',
cutsheet.PortDuplex = '$PortDuplex',
cutsheet.VlanNumber = '$VlanNumber',
cutsheet.Network = '$Network',
cutsheet.ConnType = '$ConnType',
cutsheet.Notes = '$Notes',
cutsheet.LastUpdate = '$Cdate',
cutsheet.PortDisable = '$PortDisable',
cutsheet.DatePortDisable = '$DatePortDisable',
cutsheet.TTPortDisable = '$TTPortDisable'
WHERE cutsheet.id = '$id'");

if (DB::isError($sql)) {

die($sth->getMessage());
}

$res =& $db->execute($sql, 1);

if (DB::isError($res)) {

die($res->getMessage());
}





James E. Fainer

Network Operations, Manager
Northeastern University
j.fainer@neu.edu



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com