In case the mail got lost earlier.
---------- Forwarded message ----------
From: Shoan Motwani <sh...@gm...>
Date: Thu, 12 Aug 2004 11:57:20 +0530
Subject: error handling enum in mysql when using getInsertSQL()
To: ado...@li...
Hi All,
I am using adodb v4.50 on php v5.0 running on apache v1.3.31 with mysql v4.0.20.
While testing and learning adodb, I noticed that it incorrectly
handles the enum datatype in getInsertSQL() function.
The code is as follows:
<?php
include('adodb/adodb.inc.php');
$details['username']='shoan';
$details['password']='shoanpass';
$details['user_type']='member';
$db='users';
$spotDB = &ADONewConnection('mysql');
$spotDB->debug = true;
//the variables for the statement below are defined before hand
$spotDB->Connect($db_host,$db_user,$db_pass,$db_name);
$sql = $spotDB->getInsertSQL(&$db,$details);
echo $sql;
?>
The sql statment that is displayed is as follows:
(mysql): INSERT INTO users ( USERNAME, PASSWORD, USER_TYPE ) VALUES (
'shoan', 'shoanpass', member )
That is an invalid sql statement since the value member needs be
enclosed in single quotes. Hence the following version will work:
INSERT INTO users ( USERNAME, PASSWORD, USER_TYPE ) VALUES ( 'shoan',
'shoanpass', 'member' )
Can somebody tell what I need to change in the adodb library so that
this is handled correctly?
Peace,
Shoan.
--
Shoan Motwani.
http://www.shoan.net
|