Yii Framework Forum: [Ask] Eror Cdbcommand Failed To Execute The Sql Statement: Sqlstate[23000] - Yii Framework Forum

Jump to content

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

[Ask] Eror Cdbcommand Failed To Execute The Sql Statement: Sqlstate[23000] Mohon bantuanya master.. Noob nih :) Rate Topic: -----

#1 User is offline   lutfifarid 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 27-November 13
  • Location:Sidoarjo

Posted 05 December 2013 - 09:38 PM

Master, saya baru belajar yii nih, tapi ada masalah yang saya gak paham. Ketika ngikutin tutornya mas sabit tentang cara bikin login,logout,register yang berlink : sabitlabscode*wordpress*com/2011/05/13/membuat-operasi-login-logout-dan-register-pada-yii/

penampakannya :
Attached File  eror2.PNG (31.21K)
Number of downloads: 5

waktu masuk di tombol regis keluar begini :
Attached File  eror.PNG (69.13K)
Number of downloads: 4

itu salahnya gimana ya master? mohon solusi master, terimakasih sebelumnya :)

Attached File(s)

  • Attached File  eror.PNG (69.13K)
    Number of downloads: 4

0

#2 User is offline   daudtm 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 91
  • Joined: 25-April 13
  • Location:Malang

Posted 06 December 2013 - 05:36 AM

View Postlutfifarid, on 05 December 2013 - 09:38 PM, said:

penampakannya :
Attachment eror2.PNG

itu salahnya gimana ya master? mohon solusi master, terimakasih sebelumnya :)


Integrity constraint violation itu karena foreign key mengacu ke table master yg primary keynya tidak ada.
kalo di kasus ente sepertinya tbl_user_admin.id_level (foreign key) refer ke tbl_level_admin.id_level(primary key)

lalu di form anda mengentrikan nilai id_level admin diluar yg sudah ada di tbl_level_admin (1 superadmin, 2 admin, 3 customer).
coba aja dipastiin dari form entrinya apa id_levelnya emang sudah ke isi, dan isinya harus 1,2 atau 3 (biar aman sebaiknya inputan untuk id level pada form dibuat pakai combobox saja, biar user gak ngisi lain2)
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