473,326 Members | 2,127 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,326 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://root:pvcllc@localhost/testdb 3f7988ed345b6d7c1c02f017c09f70b9
  4. DataObjects_test: CONNECT: a:1:{s:32:"3f7988ed345b6d7c1c02f017c09f70b9";O:8:"DB_mysql":8:{s:10:"autocommit";b:1;s:8:"dbsyntax";s:5:"mysql";s:3:"dsn";a:9:{s:7:"phptype";s:5:"mysql";s:8:"dbsyntax";s:5:"mysql";s:8:"username";s:4:"root";s:8:"password";s:6:"pvcllc";s:8:"protocol";s:3:"tcp";s:8:"hostspec";s:9:"localhost";s:4:"port";b:0;s:6:"socket";b:0;s:8:"database";s:8:"testdb";}s:8:"features";a:7:{s:5:"limit";s:5:"alter";s:8:"new_link";s:5:"4.2.0";s:7:"numrows";b:1;s:8:"pconnect";b:1;s:7:"prepare";b:0;s:3:"ssl";b:0;s:12:"transactions";b:1;}s:9:"fetchmode";i:1;s:22:"fetchmode_object_class";s:8:"stdClass";s:7:"options";a:8:{s:16:"result_buffering";i:500;s:10:"persistent";b:0;s:3:"ssl";b:0;s:5:"debug";i:0;s:14:"seqname_format";s:6:"%s_seq";s:8:"autofree";b:0;s:11:"portability";i:0;s:8:"optimize";s:11:"performance";}s:13:"was_connected";b:1;}}
  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
2 1797
code green
1,726 Expert 1GB
This is not very helpful
I noticed that for some of my tables my insert statement doesnt work correclty
I can't see an INSERT query.
Nevertheless this output
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO test (Name , Surname , Address , Country ) VALUES ('' , '' , '' , '-1' )
Seems to indicate that your REQUEST array is empty
Aug 5 '08 #2
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 #3

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. ...
6
by: Rowan | last post by:
Hello, I am having a problem with a join. Either I am just not seeing the obvious, it isn't possible, or I need to use a different approach. I have an application with a vsflexgrid that needs...
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...
1
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.