Advertisement
Advertisement
| 09.19.2008 at 01:25PM PDT, ID: 23747280 | Points: 500 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: |
<?php
$hostname_connShower = "domain.com";
$database_connShower = "database_name";
$username_connShower = "username";
$password_connShower = "password";
$connShower = mysql_pconnect($hostname_connShower, $username_connShower, $password_connShower) or trigger_error(mysql_error(),E_USER_ERROR);
$SQL = "UPDATE products SET ClaimedQty = ClaimedQty + 1 WHERE ID = " . $ProductID;
mysql_select_db('products', $connShower);
if(!mysql_query($SQL))
{
$mail -> Subject = 'Baby Shower MySQL Error Updating Products Table';
$mail -> Body = $SQL . '<br /><br />' . mysql_errno() . ' - ' . mysql_error();
$mail -> AddAddress('andrew@domain.com', 'Andrew Angell');
$mail -> Send();
$mail -> ClearAddresses();
}
$SQL = "INSERT INTO guests (GuestName, ClaimedProductID, GuestEmail, GuestPhone, GuestStreetAddress1, GuestStreetAddress2, GuestCity, GuestState, GuestZip)
VALUES ('" . $GuestName . "', " . $ProductID . ", '" . $GuestEmail . "', '" . $GuestPhone . "', '" . $GuestStreet1 . "', '" . $GuestStreet2 . "', '" . $GuestCity . "', '" . $GuestState . "', '" . $GuestZip . "')";
mysql_select_db('guests', $connShower);
if(!mysql_query($SQL))
{
$mail -> Subject = 'Baby Shower MySQL Error Updating Products Table';
$mail -> Body = $SQL . '<br /><br />' . mysql_errno() . ' - ' . mysql_error();
$mail -> AddAddress('andrew@domain.com', 'Andrew Angell');
$mail -> Send();
$mail -> ClearAddresses();
}
?>
|