Current location: Hot Scripts Forums » Programming Languages » PHP » Going from MySQL to Oracle, can anyone help?


Going from MySQL to Oracle, can anyone help?

Reply
  #1 (permalink)  
Old 01-11-06, 07:20 AM
imparator imparator is offline
Newbie Coder
 
Join Date: Oct 2005
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Going from MySQL to Oracle, can anyone help?

Hi guys, im in the middle of converting a script that uses a MySQL databae so that i can use it with an Oracle database. The thing is that since MySQL and Oracle functions are a bit different im a bit lost.

Can anyone help me convert the following segments of MySQL to the equivelent in Oracle?

Note: all i've included is the MySQL code that i've used

Code:
// Set MySQL Variables

	$host = 'localhost';
	$user = 'user';
	$pass = 'password';
	$db = 'my_db';
	$table = 'my_table';

mysql_connect($host,$user,$pass) or die(mysql_error());
mysql_select_db($db) or die(mysql_error());


//Print the data

	$query  = "SELECT * FROM post";
	$result = mysql_query($query);

	while($row = mysql_fetch_row($result))
	{
	    $name    = $row[0];
	    $post = $row[1];
    	$ip = $row[2];
    	$pid = $row[3];

print "$post";
}

// Connect to the Database and add the stuff

			mysql_connect($host,$user,$pass) or die(mysql_error());
			mysql_select_db($db) or die(mysql_error());
			$add_all = "INSERT INTO $table values('$name','$comment','$ip','$cid','$pid2')";
			mysql_query($add_all) or die(mysql_error());
Reply With Quote
  #2 (permalink)  
Old 01-11-06, 08:59 AM
digioz's Avatar
digioz digioz is offline
Community VIP
 
Join Date: Oct 2003
Location: Chicago, IL
Posts: 2,171
Thanks: 3
Thanked 9 Times in 9 Posts
Here is a quick tutorial on what you are looking for:

http://www.webmonkey.com/webmonkey/0...tml?tw=backend
__________________
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Useful MySQL Resources ptesone Database 30 02-23-11 08:28 AM
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
MySQL 4.1 Subquery Performance SLOW TokenSDragon PHP 2 06-15-07 12:46 PM
UPDATE: MySQL Auto Backup & Export v1.1 Beyonder General Advertisements 2 03-21-05 02:05 PM
great product for dumping/recovering MySQL databases Dave Brown General Advertisements 1 10-03-03 07:40 AM


All times are GMT -5. The time now is 06:28 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.