View: 3194|Reply: 4
|
ODBC for php connection
[Copy link]
|
mandelism This user has been deleted
|
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
- ?>
Copy the Code
any contoh example for me to use in php so tat can connect to Oracle Server tak? |
|
|
|
|
|
|
mandelism This user has been deleted
|
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 This user has been deleted
|
- <?php
- $conn=odbc_connect('database','host','pwd');
- if (!$conn)
- {exit("Database Connection Failed: " . $conn);}
- ?>
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 |
|
|
|
|
|
|
| |
|