homepage Welcome to WebmasterWorld Guest from 54.161.220.160
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
PHP & ADODB - Trouble connecting
AlexMagic



 
Msg#: 4556814 posted 2:01 pm on Mar 20, 2013 (gmt 0)

Hello! I am rather new to PHP and I'm to connect to an oracle database. I managed the connection using OCI8 directly but I've decided ADODB would help me simplify matters. I've been trying to connect using it to no avail, would anybody mind taking a look to my code?

This one works

$conn = oci_connect('NAME', 'PASSWORD', '127.0.0.1/XE');

$stid = oci_parse($conn, 'select table_name from user_tables');
oci_execute($stid);
(etc)


This one prints nothing at all though it doesn't really show the connection failed message


include('services/configuracion/adodb5/adodb.inc.php');

$conn = &ADONewConnection('oci8');
$conn->PConnect('127.0.0.1','NAME','PASSWORD', 'XE');
if (!$conn) die("Connection failed");

//var_dump($conn);

$recordSet=0;

$recordSet = $conn->Execute('select * from ld_autos');

var_dump($recordSet);


Any ideas on what I may be doing wrong? Thanks in advance!

 

coopster

WebmasterWorld Administrator coopster us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4556814 posted 10:46 am on Mar 22, 2013 (gmt 0)

Welcome to WebmasterWorld, AlexMagic.

ADOdb is not a standard PHP extension. I'm not saying that means it is bad or not popular, just that you may find less folks in the forum familiar with it. PDO is standard in PHP >= 5.1 and may be a viable alternative to try as well.

That said, am since I am also unfamiliar with ADOdb, the first place I guess I would look would be the error logs. That is, assuming ADOdb has hooks written in to write to your error logs. And have you tried to var_dump your $conn variable directly after attempting to create the new object?

$conn = &ADONewConnection('oci8'); 
var_dump($conn);

AlexMagic



 
Msg#: 4556814 posted 11:22 am on Mar 25, 2013 (gmt 0)

Thnks for your quick reply and sorry for my late one!
I did try it and it did create the class. I have, hoever, given up and just used oci8. I still really appreciate you took the time to answer, you're awfully sweet! Thanks a lot!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved