我剛剛使用API將圖像上傳到imageshack,我試圖保存從imagehack中獲取的圖像路徑。爲什麼「<image_link>」顯示在我的數據庫表字段中而未被插入?
$mgr->setUploadUrl('http://www.imageshack.us/index.php');
$fileImagePath = $row['cr_path'];
echo $fileImagePath.'<br><br>';
$res = $mgr->upload($row['cr_path'], 'image/jpeg', 'avaojo');
$newImagePath = explode(' ', $res);
$shackPath = trim($newImagePath[6]);
echo '>>>'.$shackPath.'<<<';
//Outputs >>>http://img194.imageshack.us/img194/5038/9444679.jpg<<<
$sql = "UPDATE avatar SET image_path = '$shackPath' WHERE avatar_id =".$row['cr_id'];
但是,當我查看我的MySQL數據庫時,它使用<image_link></image_link>
標籤封裝了URL字符串?
這到底是怎麼回事?我到處尋找,並在我的腳本中沒有重置$ shackPath變量。事實上,$ newImagePath的插入和修剪只有3行,並且在它之間沒有任何反應!
感謝所有
嘗試回聲 「
」; – karim79 2009-06-27 21:44:39