469,271 Members | 1,425 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

DB_dataobjects problem with Insert

Hi

I am using DB_dataobjects and pear .
I noticed that for some of my tables my insert statement doesnt work correclty ..

Those tableas are tables that i changed recently (i removed the space and added "_" and now i removed the underscore also)

So this is the output
Expand|Select|Wrap|Line Numbers
  1. DataObjects_test: CONNECT: Checking for database database_ in options
  2. DataObjects_test: CONNECT: NEW CONNECTION
  3. DataObjects_test: CONNECT: mysql://__MUNGED__@localhost/testdb 3f7988ed345b6d7c1c02f017c09f70b9
  4. DataObjects_test: CONNECT: __MUNGED__
  5. DataObjects_test: QUERY: INSERT INTO test (Name , Surname , Address , Country ) VALUES ('' , '' , '' , '-1' ) 
  6. DataObjects_test: query: QUERY DONE IN 0.00115609169006 seconds
  7.  
Notice that in the insert statement you only have Name,Surname,Address,Country...
Expand|Select|Wrap|Line Numbers
  1. $test = new DataObjects_test;
  2. DB_DataObject::debugLevel(5);
  3.  
  4.     session_start();
  5.  
  6.     $test->Name=$_REQUEST['name'];
  7.     $test->Surname=$_REQUEST['surname'];
  8.  
  9.  
  10.     $test->Address=$_REQUEST['address'];
  11.     $test->Country=$_REQUEST['country'];
  12. $test->Addedby=$_SESSION['user'] ; 
  13.     $test->Date_Added=date("d/m/y");     
  14.  
But you dont have Date_Added and Addedby .. i think it might be somnething to do with the character encoding in the particular columns but not sure.. i renamed the tables using MySQL GUI Querty manager

and here are the tables in question
Expand|Select|Wrap|Line Numbers
  1. DROP TABLE IF EXISTS `testdb`.`test`;
  2. CREATE TABLE  `testdb`.`test` (
  3.   `Name` varchar(50) default NULL,
  4.   `Surname` varchar(50) character set utf8 default NULL,
  5.   `Address` varchar(50) default NULL,
  6.   `Country` varchar(50) character set utf8 default NULL,
  7.   `City` varchar(50) character set utf8 default NULL,
  8.   `Phone Landline` varchar(50) character set utf8 default NULL,
  9.   `Genre` varchar(50) character set utf8 default NULL,
  10.   `Email` varchar(200) character set utf8 default NULL,
  11.   `Rates` varchar(50) character set utf8 default NULL,
  12.   `Extra Info` varchar(50) character set utf8 default NULL,
  13.   `Web Address` text character set utf8,
  14.   `Proffesion` varchar(50) character set utf8 default NULL,
  15.   `Phone Mobile` varchar(50) character set utf8 default NULL,
  16.   `Address Street` varchar(50) character set utf8 default NULL,
  17.   `Adress Postcode` varchar(50) character set utf8 default NULL,
  18.   `Nickname` varchar(50) character set utf8 default NULL,
  19.   `Description/Other Info` varchar(100) character set utf8 default NULL,
  20.   `Addedby` varchar(50) default NULL,
  21.   `Date_Added` varchar(50) default NULL,
  22.   `Date Contacted` varchar(50) character set utf8 default NULL,
  23.   `Picture` varchar(50) character set utf8 default NULL,
  24.   `Id` int(10) unsigned NOT NULL auto_increment,
  25.   PRIMARY KEY  (`Id`)
  26. ) ENGINE=MyISAM AUTO_INCREMENT=1190 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
  27.  
Any help will be really appreciated

Thanks
Aug 4 '08 #1
1 1254
Hi

Thanks for the reply

The problem was thet i modified the database but i havent generated the classs for the newly modfied tabels that why the insert didnt work :-)
Aug 6 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Philip Hachey | last post: by
3 posts views Thread by Christian Christmann | last post: by
6 posts views Thread by Mark P | last post: by
4 posts views Thread by Driesen via SQLMonster.com | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.