我似乎无法让它工作,所有静态数据都有效,但对于下面的变量,
$customf = $row["ps_custom_fields"];
$cfarr = unserialize($customf);
$name = $cfarr[5];
$desc = $cfarr[2];
$cat = $cfarr[3];
$tags = $cfarr[4];
我无法让他们将数据传送到下一个数据库并输入我需要的所有数据,它用于一个广告系统,该系统运行另一个处理所有发票、购买和数据收集的数据库,第二个数据库只是输出到广告网站。
//Connect to Local Server Database
$link1 = mysql_connect("localhost","usr","pass") or die("Opps Local Connection Failed!");
$db = mysql_select_db("pulseem1_ipb",$link1) or die ("Local Connection Failed Again!");
//Select Result to pull
$result = mysql_query("SELECT ad_id, ad_image, ad_link FROM ipb_nexus_ads")
or die ("Results Didnt pull Correctly!");
//Second Results to pull
$result2 = mysql_query("SELECT ps_custom_fields FROM ipb_nexus_purchases")
or die ("Second Results Didnt pull Correctly!");
while ($row = mysql_fetch_array($result,$result2))
{
//Put Results into a Variable
$customf = $row["ps_custom_fields"];
$cfarr = unserialize($customf);
$name = $cfarr[5];
$desc = $cfarr[2];
$cat = $cfarr[3];
$tags = $cfarr[4];
$url = $row["ad_link"];
$image = $row["ad_image"];
}
//Upload Advert to Remote Host with values of Variables
//Connect To Remote Database
$link2 = mysql_connect("localhost","user","pass") or die("Opps Second Connection Failed!");
$db = mysql_select_db("onlyclic_adverts",$link2) or die ("Second Connection Failed Again!");
// Insert Values from Original Database
mysql_query("INSERT INTO busadverts (advert_name, advert_url, advert_image, advert_description, advert_catergory, advert_tags, active) VALUES ('$name','$url','$image','$desc','$cat','$tags','1')");
//Release Connection and Results