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_port, 25);
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 == 0 ) {
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')";
$cur= odbc_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