Yii Framework Forum: eror bingung - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

eror bingung apakah ad yg salah dengan tatan script Rate Topic: ***** 1 Votes

#1 User is offline   ubuntu 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 11-June 12

Posted 12 June 2012 - 06:27 AM

gan q baru di yii ! :P

bingung ni pakah ada yg salah

'Yii::app()->Db->createCommand("SELECT SUM(b.sks) `jumlah_sks` FROM tbl_akademik a 
								INNER JOIN tbl_matakuliah b 
								ON a.tbl_matakuliah_id=b.id 
								WHERE a.id_user=\'".Yii::app()->user->id."\'")
								->queryAll()[0]["jumlah_sks"]+$data->sks<=24 
								&& empty($data->akademiks)'


error :

Parse error: syntax error, unexpected '[' in .../htdocs/yii/framework/base/CComponent.php(607) : eval()'d code on line 6

ini knp agan? tolong pencerahannya
0

#2 User is offline   junxiong 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 543
  • Joined: 21-June 10

Posted 12 June 2012 - 08:20 AM

coba ganti ->queryAll()[0] jadi ->query() saja.
“The most likely way for the world to be destroyed, most experts argue, is by accident. That’s where we come in; we’re computer professionals. We cause accidents.” - Nathaniel Borenstein

Yii Playground : Collaborative demo apps. You can join to improve it too!
My Team's Blog: In Indonesian.
0

#3 User is offline   ubuntu 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 11-June 12

Posted 12 June 2012 - 09:16 PM

View Postjunxiong, on 12 June 2012 - 08:20 AM, said:

coba ganti ->queryAll()[0] jadi ->query() saja.


terimmaksh atas infonya
tetapi masih eror gan

Object of class CDbDataReader could not be converted to int 


anehnya ini bisa di apache tm aq beri arry stelah queryall()[0][`jumlah_sks`] + $data-sks <= 24 mw jalan sedangkan aq xampp g mw jalan eror

Parse error: syntax error, unexpected '[' in .../htdocs/yii/framework/base/CComponent.php(607) : eval()'d code on line 6


apakah itu perngaruh ???

aq ubah dengan queryAll() <= 24 algoritmanya g jalan !!!! hehheeheh jadi bingung aq coba dulu!!! Tq ya agan :lol:
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users