Computing.Net > Forums > Programming > MySQL 5 > 4

MySQL 5 > 4

Reply to Message Icon

Original Message
Name: Palookaville
Date: March 14, 2006 at 16:32:31 Pacific
Subject: MySQL 5 > 4
OS: XP
CPU/Ram: XP 2800 / 1GB
Model/Manufacturer: Me
Comment:

I need a little help to convert some MySQL 5 functions, to MySQL 4. I am new to mysql and had to do an assignment using MySQL. I used a book which uses MySQL 5, but the database, and website is hosted on a server running MySQL 4, so it is reporting errors. The code makes use of MySQL 5's extended functions, but should be quite simple to convert, I just can't work it out. I have tried a few examples I found on the net, but can not get it to work. I am using transactions, as I do not want to commit the data until everything is verified. I think i need to start it with something like: AUTOCOMMIT = 0; and START TRANSACTION.

Below is a sample of the code, if anyone could suggest how to change it for use with MySQL 4, it would be very helpful. Thanks

require_once ('db_connection.php');

mysqli_autocommit($dbc, FALSE);

$query = "INSERT INTO orders (customer_id, total) VALUES ($customer_id, $total)";
$result = mysqli_query ($dbc, $query);

if (mysqli_affected_rows($dbc) == 1) {
mysqli_commit($dbc);
mysqli_close($dbc);
} else {
echo "Error!";
}


Report Offensive Message For Removal


Response Number 1
Name: wizard-fred
Date: March 15, 2006 at 01:41:37 Pacific
Subject: MySQL 5 > 4
Reply: (edit)

First find the differences in version 5 from version 4 of the software. Most of them should be the what's new file. Then get a copy of the version 4 commands and compare them with version 5. Then make a working version 4 that will does the procedures needed.


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: MySQL 5 > 4

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 3 Days.
Discuss in The Lounge