Postingan lainnya
Cara Memperbaiki A Database Error Occurred Error Number: 1064
Mohon bantuannya error yang saya temukan seperti ini :
A Database Error Occurred
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ORDER BY `user_access_menu`.`menu_id` ASC' at line 5
SELECT `user_menu`.`id`,`menu` FROM `user_menu` JOIN `user_access_menu` ON `user_menu`.`id` = `user_access_menu`.`menu_id` WHERE `user_access_menu`.`role_id`= ORDER BY `user_access_menu`.`menu_id` ASC
Filename: D:/xampp/htdocs/wpu-login/system/database/DB_driver.php
Line Number: 691
<?php
$role_id = $this->session->userdata('role_id');
$queryMenu = "SELECT `user_menu`.`id`,`menu`
FROM `user_menu` JOIN `user_access_menu`
ON `user_menu`.`id` = `user_access_menu`.`menu_id`
WHERE `user_access_menu`.`role_id`= $role_id
ORDER BY `user_access_menu`.`menu_id` ASC";
$menu = $this->db->query($queryMenu)->result_array();
var_dump($menu);
die;
?>
6 Jawaban:
<div>Your issue is similar to mine, I also faced such issue of data base error and I tried many ways and tricks to solve the issue but nothing worked for me, While searching, I found this guide: <a href="https://codup.co/error-establishing-a-database-connection/">https://codup.co/error-establishing-a-database-connection/</a> . Here they have mentioned the several ways to fix this database error, which I also applied and its worked for me and resolved my issue. Hopefully it may useful for you and the other members of community too.</div>
Tanggapan
Maaf, mksdnya gimana ya kak ?
<div>Coba baris kode ini :</div><pre>$queryMenu = "SELECT user_menu
.id
,menu
FROM user_menu
JOIN user_access_menu
ON user_menu
.id
= user_access_menu
.menu_id
WHERE user_access_menu
.role_id
= $role_id
ORDER BY user_access_menu
.menu_id
ASC";</pre><div><br>diubah menjadi :</div><pre>$queryMenu = "SELECT user_menu
.id
,menu
FROM user_menu
JOIN user_access_menu
ON user_menu
.id
= user_access_menu
.menu_id
WHERE user_access_menu
.role_id
= $role_id
ORDER BY menu_id
ASC";</pre><div><br>Semoga berhasil.</div>
Tanggapan
udah aku coba, masih sama kak errornya
aku baca di forum ini juga pertanyaan hampir sama seperti ini cuma aku gk dapat solusinya, katanya masalahnya di versi mariadb nya udah aku ganti ngikut versi yang punya tutorial mah sama aja error kak :)
Coba struktur tabelnya fotoin seperti apa..
siap kak ....
<div>seperti ini kak @ahanafi</div><div class="attachment-gallery attachment-gallery--3"><figure data-trix-attachment="{"contentType":"image/png","filename":"Screenshot (28).png","filesize":179358,"height":768,"url":"https://i.ibb.co/0nYXjsF/Screenshot-28.png","width":1366}" data-trix-content-type="image/png" data-trix-attributes="{"presentation":"gallery"}" class="attachment attachment--preview attachment--png"><img src="https://i.ibb.co/0nYXjsF/Screenshot-28.png" width="1366" height="768"><figcaption class="attachment__caption"><span class="attachment__name">Screenshot (28).png</span></figcaption></figure><figure data-trix-attachment="{"contentType":"image/png","filename":"Screenshot (26).png","filesize":197753,"height":768,"url":"https://i.ibb.co/sPBXQDB/Screenshot-26.png","width":1366}" data-trix-content-type="image/png" data-trix-attributes="{"presentation":"gallery"}" class="attachment attachment--preview attachment--png"><img src="https://i.ibb.co/sPBXQDB/Screenshot-26.png" width="1366" height="768"><figcaption class="attachment__caption"><span class="attachment__name">Screenshot (26).png</span></figcaption></figure><figure data-trix-attachment="{"contentType":"image/png","filename":"Screenshot (27).png","filesize":183058,"height":768,"url":"https://i.ibb.co/RBLPFxD/Screenshot-27.png","width":1366}" data-trix-content-type="image/png" data-trix-attributes="{"presentation":"gallery"}" class="attachment attachment--preview attachment--png"><img src="https://i.ibb.co/RBLPFxD/Screenshot-27.png" width="1366" height="768"><figcaption class="attachment__caption"><span class="attachment__name">Screenshot (27).png</span></figcaption></figure></div>
<div>biasa data session user data nya kosong</div>
<pre>$role_id = $this->session->userdata('role_id');
$queryMenu = "SELECT user_menu
.id
,menu
FROM user_menu
JOIN user_access_menu
ON user_menu
.id
= user_access_menu
.menu_id
WHERE user_access_menu
.role_id
= ".$role_id."
ORDER BY user_access_menu
.menu_id
ASC";
$menu = $this-&gt;db-&gt;query($queryMenu)-&gt;result_array();
<br></pre><div> coba di bedain , kasih tanda petik kak<br><br></div><div><br></div>
<div>until you are someplace within the orbit of the jacksonville franchise or spend it gradual analyzing the nfl’s unrelenting drumbeat of business company operations, you possibly didn’t phrase. however there’s a motive that london expiration is going to be of some essential significance to the nfl in 2021. leader among them are 3 large elements of commercial corporation associated with the league and the jaguars inside the coming months. and trust it or now not, the team securing the no. 1 basic select inside the 2021 nfl draft — and in all likelihood the future of clemson quarterback trevor lawrence in a jaguars uniform — may additionally need to issue into alternatives that shift loads of thousands and thousands of greenbacks in nfl selections, if no longer billions. <a href="https://www.worldescortshub.com/us/bostonmaescorts">boston escort sites</a></div>