mandelism Publish time 29-12-2006 03:53 PM

ODBC for php connection

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


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


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

neotoxin Publish time 30-12-2006 12:16 AM

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

mandelism Publish time 2-1-2007 11:05 PM

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?

mandelism Publish time 3-1-2007 05:51 PM

<?php
$conn=odbc_connect('database','host','pwd');
if (!$conn)
{exit("Database Connection Failed: " . $conn);}

?>

that is the code needed :P 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

walkermore Publish time 26-3-2010 04:56 PM

sounds good to me
Pages: [1]
View full version: ODBC for php connection


ADVERTISEMENT