2014-05-01 58 views
-4

好吧,我有我的網站,而循環功能,拉在Excel文檔,並將其解析到我要重複檢查數據庫,如果重複的略過它:下一頁聲明與PHP

$content = file($selectfile1); 

$posted_content = array(); 
list($rownum, $row) = each($content); 
$posted_content[0] = explode(",", $row); 
array_push($posted_content[0], "ID"); 
$count = 0; 
// iterate each row (1 post) 
while (list($rownum, $row) = each($content)) 
{ 
    $count++; 

    $cols = "orderid, created_at, updated_at, notification_type, radius, available, expiration, "; 
    $vals = ""; 
    $cols2 = "equipment_id"; 
    $vals2 = ""; 

....{parsing data)... 
} 

我想寫一個腳本來檢查記錄是否重複,如果不輸入。

$sql25 = "SELECT * FROM notifications WHERE origin =" . $origin_id . " user_id =12039"; 
$rs25 = $conn->Execute($sql25); 
if($rs25->RecordCount() == 1 || $rs25->RecordCount() >= 1) 
    { 



here is where i need a command. Can you use? next() 
-------------------------------------------------- 


    } 
else 
{ 
     Insert query 
    } 
+5

你的意思是 '繼續'? –

+0

是繼續在PHP的命令將進入下一個循環 – user3568861

+0

是................... –

回答