I am using this to get the info from the temporary table and add them to the actual table:
Code: Select all
// get the information from the unpaid table
$sql = mysql_query("SELECT * FROM temporary WHERE track_ID='$track_ID' LIMIT 1");
$productCount = mysql_num_rows($sql); // count the output amount
if ($productCount > 0)
{
while($row = mysql_fetch_array($sql))
{
// get the information from notpaid table
$id = $row["id"];
$UserName = $row["UserName"];
$firstname = $row["firstname"];
$lastname = $row["lastname"];
$producttittle = $row["producttittle"];
$productdescription = $row["productdescription"];
$swaptakeplace = $row["swaptakeplace"];
$ExchangeWithTittle = $row["ExchangeWithTittle"];
$ExchangeWithDescription = $row["ExchangeWithDescription"];
$shippingfirstname = $row["shippingfirstname"];
$shippinglastname = $row["shippinglastname"];
$address1 = $row["address1"];
$address2 = $row["address2"];
$city = $row["city"];
$country = $row["country"];
$postalcode = $row["postalcode"];
$phonenumber = $row["phonenumber"];
$Category = $row["Category"];
$email = $row["email"];
$ipaddress = $row["IpAddress"];
// Add the exchange into the specified table
$addsql = mysql_query("INSERT INTO $Category (track_ID, UserName, firstname, lastname, producttittle, productdescription, swaptakeplace ,ExchangeWithTittle,ExchangeWithDescription, shippingfirstname, shippinglastname, address1, address2, city, country, postalcode, phonenumber, email, Category, IpAddress, dateadded) VALUES ('$track_ID','$UserName','$first_name','$last_name','$producttittle','$productdescription', '$swaptakeplace' ,'$ExchangeWithTittle','$ExchangeWithDescription','$shippingfirstname','$shippinglastname','$address1','$address2','$city','$country','$postalcode','$phonenumber','$email','$Category','$ipaddress',now())");
}
}