2014-11-08 96 views
0

公告:未定義的索引:在/opt/lampp/htdocs/content/cron/check_deposits.php類上線18注意:未定義指數:類

$deposits=mysql_query("SELECT * FROM `deposits`"); 
while ($dp=mysql_fetch_array($deposits)) { 
    $received=0; 
    $txid=''; 
    $txs=$wallet->listtransactions('',2000); 
    $txs=array_reverse($txs); 
    foreach ($txs as $tx) { 
    if($tx['category']!='receive') continue; 
    if ($tx['confirmations']<1) continue; 
    if ($tx['address']!=$dp['address']) continue; 
    $received=$tx['amount']; 
    $txid=$tx['txid']; 
    break; 

這是怎麼出來的框。我聯繫了有關該問題的支持,並且他們告訴我確保我使用的是PHP 5.3.1。這有什麼問題?

下面是完整的代碼的鏈接: http://diceking.tk/deposit.txt

回答

0

你需要的,如果變量被設置爲從

if($tx['category']!='receive') continue; 

改變

if(isset($tx['category']) && $tx['category']!='receive') continue; 
+0

現在我得到 注意:未定義索引:第19行中的/opt/lampp/htdocs/content/cron/check_deposits.php中的確認 – 2014-11-08 11:29:32

0

檢查。 所以,關於確認錯誤,您可以使用此:

if(isset($tx['confirmations']) && $tx['confirmations'] < 1) continue; 

有關未定義的索引中的差錯:類別您可以使用此:

if(isset($tx['category']) && $tx['category']!='receive') continue; 

我希望我會幫你。 如果這有幫助,請投我的答案。

0

說明:未定義指數:未定義指數::TxID添加在/ opt/LAMPP/htdocs中/內容/ cron的/ check_deposits第21行 通知量/opt/lampp/htdocs/content/cron/check_deposits.php .php on line 22 注意:未定義索引:第21行的/opt/lampp/htdocs/content/cron/check_deposits.php中的金額 注意:未定義索引:/ opt/lampp/htdocs/content/cron/check_deposits中的txid .PHP在線22

啊所以我們走到今天這一步。我想這招,它恨我吧:

if(isset($received=$tx['amount']) && $received=$tx['amount']) continue;