Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-18-2007, 02:06 AM
Junior Member
 
Join Date: Feb 2007
Posts: 15
Default Need info on how to connect to Db2

Hi

I have gone through the manual with out being able to find any information about how to connect to a Db2 file!

here is the section of code I am trying to use
Code:
$params = array(
		'username' => 'username',
		'password' => 'password',
		'dbname' => 'systemname'
		);
		$DB = Zend_Db::factory('Db2' , $params);
		$row = array(
		'FNAME' => $_POST['fName'],
		'LASTNAME' => $_POST['lName'],
		'EMAIL' => $_POST['email'],
		'USRNAMR' => $_POST['user'],
		'PASSWD' => $_POST['pass']
		);
		$table = 'SHIELDCRM.USERS';
		$rowsAffected = $DB->insert($table, $row);
I put in an echo and I can see it starting in the function, but I get no errors and I dont get the file updated! the user, db and password are OK I use them in the studio and it shows up just fine.

Help is appreciated.

Chris...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-18-2007, 05:05 AM
Cristian's Avatar
Administrator
 
Join Date: Feb 2007
Location: Sibiu, Romania
Posts: 101
Default

Check webserver logs about what error is it.

Alternatively you can just put at beginning of code:

ini_set('display_errors', true);
error_reporting(E_ALL);

Also, this tutorial is also about DB2. Check it too.

Work with XML Data in the Zend FrameworkWork with XML Data in the Zend Framework « View Tutorial*
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-18-2007, 04:57 PM
Junior Member
 
Join Date: Feb 2007
Posts: 15
Default

Looks like the forums are being updated as pervious posts seem to have gone? Anyhow I now have a connection but get a problem with the insert
Failed in DB Insert Error occurred in SQL Call Level Interface SQLCODE=-99999
I have looked at the web for an answer but cant find one which seems to relate?

Any suggestions? I have tried to review the documentation but they dont really give any pointers.

Chris..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-19-2007, 05:20 PM
Junior Member
 
Join Date: Feb 2007
Posts: 15
Default It now works!

OK I think I have solved the problem and I can now access the DB?

I am not sure why either? I tried setting up the MySQL connection as I was so frustrated with this only to find out i5 Zendcore does not ship with the pdo modules at all?

Having gone through hours of testing and changing configs I now have something which works! So I am not looking back...

Chris...

Thanks for the support!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 09:57 PM.