Adding into data base
Posted: Mon Oct 03, 2011 7:36 am
Hi,
I have to databases:
1- Temporary:
2- pcvideogaming
I want to transfer a row from database 1 into database 2 and I am using this code:
The code above work fine but I want to transfer the product description field too so I use this which does not work or insert it:
The product description is a text type in the database and it contains 4000 character in the database 1.
Please help
Youssef
I have to databases:
1- Temporary:
2- pcvideogaming
I want to transfer a row from database 1 into database 2 and I am using this code:
Code: Select all
<?php
include_once "includes/UK.php";
$sql = mysql_query("SELECT * FROM temporary WHERE track_ID='31UKSiblini' 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 pcvideogaming (track_ID, UserName, firstname, lastname, producttittle, dateadded) VALUES ('$track_ID','$UserName','$firstname','$lastname','$producttittle',now())");
}
?>
Code: Select all
$addsql = mysql_query("INSERT INTO $Category (track_ID, UserName, firstname, lastname, producttittle,productdescription, dateadded) VALUES ('$track_ID','$UserName','$firstname','$lastname','$producttittle','$productdescription',now())");
Please help
Youssef