第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

消息:count(): 參數(shù)必須是一個(gè)數(shù)組或一個(gè)在 centos 上實(shí)現(xiàn) Countable

消息:count(): 參數(shù)必須是一個(gè)數(shù)組或一個(gè)在 centos 上實(shí)現(xiàn) Countable

PHP
守著一只汪 2023-03-04 17:26:55
查看我的查詢Select * from join_chat where(user_1 = '24' and user_2 = '26') or(user_1 = '26' and user_2 = '24')請從我的 api 中提供解決此錯(cuò)誤的建議<h4>A PHP Error was encountered</h4><p>Severity: Warning</p></div>{"responce":true,"data":"20"}43.303 28439-30249/techline.carsapp W/System.err: 在 java.util.concurrent.FutureTask.run(FutureTask.java:266) 2020-05-09 23:16:43.303 28439-30249/techline.carsapp W/ System.err: 在 android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) 2020-05-09 23:16 :43.303 28439-30249/techline.carsapp W/System.err: 在 java.util. concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 2020-05-09 23:16:43.303 28439-30249/techline.carsapp W /System.err: 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor. java:641) 2020-05-09 23:16:43.303 28439-30249/techline.carsapp W/System.err: 在 java 中。lang.Thread.run(線路.java:764)FutureTask.run(FutureTask.java:266) 2020-05-09 23:16:43.303 28439-30249/techline.carsapp W/System.err: 在android.os。 AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) 2020-05-09 23:16:43.303 28439-30249/techline。消息:count():參數(shù)必須是數(shù)組或?qū)崿F(xiàn) Countable 的對象文件名:controllers/Api.php行號(hào):801    <p>Backtrace:</p>下面控制器中的方法public function send_chat_data(){    $this->load->library('form_validation');    $this->form_validation->set_rules('join_id', 'join_id', 'trim|required');    $this->form_validation->set_rules('sender_id', 'sender_id', 'trim|required');    $this->form_validation->set_rules('message', 'message', 'trim|required');
查看完整描述

1 回答

?
德瑪西亞99

TA貢獻(xiàn)1770條經(jīng)驗(yàn) 獲得超3個(gè)贊

正如我所見,您問題中的問題是您正在嘗試計(jì)算一個(gè)非數(shù)組或不可數(shù)的對象。

思緒

  1. 在您的整個(gè)代碼中,您沒有編寫count()似乎導(dǎo)致問題的原因,為什么?

  2. $q->row();當(dāng)您自己將結(jié)果限制為 1 時(shí),為什么還需要計(jì)數(shù)// as you said the problem is here $row = $q->row();

可能的解決方案

當(dāng)您使用row()ie時(shí),$q->row();您會(huì)得到一個(gè)不可數(shù)的對象,

// row() dummy data

stdClass Object

(

? ? [id] => 15

? ? [event_id] => 3

? ? [event_image] => c1fa8a5d5505047251fd928aa312b16c.jpg

)

但是當(dāng)你使用result()ie時(shí)$q->result();,它會(huì)產(chǎn)生一個(gè)對象數(shù)組,或者在 的情況下result_array(),一個(gè)數(shù)組數(shù)組,即使你將它們限制為一個(gè)。


// result() dummy data -- same as result_object()

(

? ? [0] => stdClass Object

? ? ? ? (

? ? ? ? ? ? [id] => 15

? ? ? ? ? ? [event_id] => 3

? ? ? ? ? ? [event_image] => c1fa8a5d5505047251fd928aa312b16c.jpg

? ? ? ? )


)


// result_array() dummy data

Array

(

? ? [0] => Array

? ? ? ? (

? ? ? ? ? ? [id] => 15

? ? ? ? ? ? [event_id] => 3

? ? ? ? ? ? [event_image] => c1fa8a5d5505047251fd928aa312b16c.jpg

? ? ? ? )


)

它們現(xiàn)在都是一個(gè)數(shù)組,因此是可數(shù)的。

所以,如果你必須計(jì)算,使用此外,如果你想計(jì)算“結(jié)果”的數(shù)量,你可以使用which will return 3 here。
$q->row();
count((array) ($q->row()));
{id}, {event_id}, {event_image}

希望對你有幫助。


查看完整回答
反對 回復(fù) 2023-03-04
  • 1 回答
  • 0 關(guān)注
  • 169 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)