Reply
Converting from MSAccess to MySQL - help!
Old 05-18-2007, 02:52 PM Converting from MSAccess to MySQL - help!
croix's Avatar
Skilled Talker

Posts: 87
Name: Colin Roy
Location: Dallas, TX
OK, I have a new host, and thus I now have the ability to use MySQL instead of Access.

I have a simple script, which I need to convert the code to utilize the new database.

I have already migrated the tables and data over to the new database with SQLyog

OK, here's the current code:

PHP Code:
<?php

if (isset($_POST['company'])) {
    
$company $_POST['company'];
    
$firstname $_POST['firstname'];
    
$lastname $_POST['lastname'];
    
$address1 $_POST['address1'];
    
$address2 $_POST['address2'];
    
$city $_POST['city'];
    
$state $_POST['state'];
    
$zip $_POST['zip'];
    
$country $_POST['country'];
    
$outside_us $_POST['outside_us'];
    
$phone $_POST['phone'];
    
$website $_POST['website'];
    
$fax $_POST['fax'];
    
$email $_POST['email'];
    
$store_type $_POST['store_type'];
    
$comments $_POST['comments'];
    
$referral $_POST['referral'];

    
$msg "Attention Sliquid! You have a new vendor request!
Company Name = {$company} 
First Name = {$firstname}
Last Name = {$lastname}
Address = {$address1}
Address 2 = {$address2}
City = {$city}
State = {$state}
Zip = {$zip}
Country = {$country}
Shipping Info = {$outside_us}
Phone = {$phone}
Website = {$website}
Fax = {$fax}
Email = {$email}
Store Type = {$store_type}
Comments = {$comments}
Referred By = {$referral}"
;

Enter_New_Entry($company,$firstname,$lastname,$address1,$address2,$city,$state,$zip,$country,$outside_us,$phone,$website,$fax,$email,$store_type,$comments,$referral);

    
//ini_set(SMTP, "smtp.sliquid.com");
    
ini_set(SMTP"mail.sliquid.com");
    
ini_set(smtp_port25);
    
ini_set(sendmail_from"sales@sliquid.com");
    
$headers "From: sales@sliquid.com\r\n";
    
$headers .= "BCC: dean@sliquid.com\r\n";
    
//mail(To, subject, content, header);
    
$to "sales@sliquid.com";
    
$result  mail($to"New Vendor Request"$msg$headers);
    if( 
$result == ) {
        echo 
"error <br>";
    
    }
}
function 
Enter_New_Entry 
($company,$firstname,$lastname,$address1,$address2,$city,$state,$zip,$country,$outside_us,$phone,$website,$fax,$email,$store_type,$comments,$referral) {

$cnx odbc_connect'records_db' '******''********' );
    if (!
$cnx) {
        
Error_handler"Error in odbc_connect" $cnx );
    }

    
$SQL_Exec_String "Insert Into distributors (company, firstname, lastname, address1, address2, city, state, zip, country, outside_us, phone, website, fax, email, store_type, comments, referral)
            Values ('$company', '$firstname', '$lastname', '$address1', '$address2', '$city', '$state', '$zip', '$country', '$outside_us', '$phone', '$website', '$fax', '$email', '$store_type', '$comments', '$referral')"
;

    
$curodbc_exec$cnx$SQL_Exec_String );
    if (!
$cur) {
        
Error_handler"Error in odbc_exec( no cursor returned ) " $cnx );
 }

odbc_close($cnx);  
 
header("location: http://www.sliquid.com/verify.htm"); 

}
 
?>
I found out how to change my db connection to mysql, but im lost on teh other parts (mysql_connect, mysql_exec?)

any ideas, solutions, or links to something that will show me all the equivalent functions between access and mysql?

Thanks
\colin

Last edited by croix : 05-18-2007 at 05:12 PM.
croix is offline
Reply With Quote
View Public Profile Visit croix's homepage!
 
When You Register, These Ads Go Away!
Old 05-20-2007, 07:29 AM Re: Converting from MSAccess to MySQL - help!
kids's Avatar
Ultra Talker

Posts: 271
I have an simple way:
- export MSAccess --> sqlfile.txt
- enter your cpanel and open phpMyAdmin
- select your database and import from sqlfile.txt

kids is offline
Reply With Quote
View Public Profile Visit kids's homepage!
 
Old 05-21-2007, 10:43 AM Re: Converting from MSAccess to MySQL - help!
croix's Avatar
Skilled Talker

Posts: 87
Name: Colin Roy
Location: Dallas, TX
i already have migrated the tables and data over.

the problem is not the migration, its the language
croix is offline
Reply With Quote
View Public Profile Visit croix's homepage!
 
Old 05-21-2007, 11:29 AM Re: Converting from MSAccess to MySQL - help!
damien_ls's Avatar
Layershift

Posts: 435
Name: Damien
I guess a good start would be the appropriate section of the PHP manual: http://www.php.net/manual/en/ref.mysql.php

You may also be interested in:
It looks like you just need to change your connection function call, and the query execution call. You'll find all the information you need for that (and a few examples etc.) on the pages above.
__________________
Layershift :: DDS & Dedicated, UK & USA-based Managed Virtuozzo VPS, Reseller & Shared Hosting
Experienced Parallels Platinum Partners (Plesk since 2001, Virtuozzo since 2004)
damien_ls is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Converting from MSAccess to MySQL - help!
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13134 seconds with 12 queries