CARI Infonet

 Forgot password?
 Register

ADVERTISEMENT

View: 3124|Reply: 4

ODBC for php connection

[Copy link]
mandelism This user has been deleted
Post time 29-12-2006 03:53 PM | Show all posts |Read mode
guys, sorri noobie in oravle databse here :p
slalu guna mysql je, tiba2 opis guna oracle..wahaha

how do i create a connecting script in php for oracle? i usualy use this for mysq


  1. <?php
  2. $host = "localhost";//connect localhost mySQl
  3. $user = "root";//the user
  4. $password = "hehe";//password for table
  5. $connection = mysql_connect($host, $user, $password) or die ("Cannot connect to the MySQL server ". mysql_error()); //step 1: connect to the MySQL server
  6. mysql_select_db("hehe") or die ("Cannot select database " . mysql_error()); //step 2: Select a database
  7. ?>
Copy the Code


any contoh example for me to use in php so tat can connect to Oracle Server tak?
Reply

Use magic Report


ADVERTISEMENT


Post time 30-12-2006 12:16 AM | Show all posts
i dont use oracle as well (I'm usually work with either mssql or mysql), but you might want to look at php.net

http://my2.php.net/manual/en/ref.oci8.php
Reply

Use magic Report

mandelism This user has been deleted
 Author| Post time 2-1-2007 11:05 PM | Show all posts
thkx dude, shall look at it, infact, kalo dah dapat jawapan, aku post sini, can use for future reference

aah..orang lain tarak tau ka?
Reply

Use magic Report

mandelism This user has been deleted
 Author| Post time 3-1-2007 05:51 PM | Show all posts
  1. <?php
  2. $conn=odbc_connect('database','host','pwd');
  3. if (!$conn)
  4.   {exit("Database Connection Failed: " . $conn);}

  5. ?>
Copy the Code


that is the code needed as simple as ABCD.wahaha! only the first line of code is needed, the 2nd n 3rd is to check if connection is established

hope this helps ppl
Reply

Use magic Report

Post time 26-3-2010 04:56 PM | Show all posts
sounds good to me
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

 

ADVERTISEMENT



 

ADVERTISEMENT


 


ADVERTISEMENT
Follow Us

ADVERTISEMENT


Mobile|Archiver|Mobile*default|About Us|CARI Infonet

28-4-2024 02:31 AM GMT+8 , Processed in 0.492013 second(s), 31 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

Quick Reply To Top Return to the list