473,390 Members | 1,140 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 software developers and data experts.

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 1437
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

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

Similar topics

2
by: Philip Hachey | last post by:
I think this is do-able, and possibly even simple, but it's been too many years since I've done anything significant with SQL. Any help would be appreciated. I have two tables, PAY and CHG. ...
4
by: Spark | last post by:
Hi, Situation: Need a query to return number of ticket records by month of open in a log table where the ticket open record is older than 24 hours then the ticket pending or ticket closed...
3
by: Christian Christmann | last post by:
Hi, I've a class htable.cpp with a private member: map<string, void*> stringhash; and a function: "void HashTable::Insert(char* ky,void* entr) { strhash.insert(pair<string, void*>(ky,...
6
by: Mark P | last post by:
Some time ago I posted here about inserting into a set with a hint: ...
3
by: Myron | last post by:
I'm trying to create a query that will tell me which requests took longer than 10 days to move one from particular state to another state. The query I've created returns the correct requests, but...
4
by: Driesen via SQLMonster.com | last post by:
Hi guys I having trouble with this sproc. I get the following error when testing: Server: Msg 245, Level 16, State 1, Procedure UTL_CompletenessCheckLoan, Line 231 Syntax error converting the...
4
by: Chris Kratz | last post by:
Hello all, We have run into what appears to be a problem with rules and subselects in postgres 7.4.1. We have boiled it down to the following test case. If anyone has any thoughts as to why...
17
Ganon11
by: Ganon11 | last post by:
Hey guys, OK, taking care of this beforehand; I AM a student in a university. This IS part of my homework, and (as a moderator), I'm doing my best to follow the posting guidelines I work so hard...
2
by: panos100m | last post by:
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.