How to fix Error Number: 1054 Unknown column 'Array' in 'where clause'Unknown Column In Where ClauseError: Unknown column 'Array' in 'where clause'How to fix “Headers already sent” error in PHPPassing 2 strings through array to the where clause in codeigniterUnknown column 'Array' in 'where clause' SQL=SELECT * FROM #__content WHERE Array = '4'Multiple search field codeigniter database error unknown column 'array' in 'where clause'Running query inside loopError when trying to fetch data from a database using CodeIgniterError Number: 1054 Unknown column in where clauseError while executing Query in Codeigniter

Party going through airport security at separate times?

Computer name naming convention for security

Did depressed people far more accurately estimate how many monsters they killed in a video game?

What was this character's plan?

Did Rabbi Akiva accept arguments from ignorance?

Did right-wing politician Franz Josef Strauss ever explain why he gave a 3 billion loan to East Germany in 1983?

What does the multimeter dial do internally?

US citizen traveling with Peruvian passport

What are the consequences for a developed nation to not accept any refugees?

Performance issue in code for reading line and testing for palindrome

Swapping "Good" and "Bad"

Would a Nikon FG 20 film SLR camera take pictures without batteries?

Optimization models for portfolio optimization

A sequence that changes sign finally at infinity?

Why AI became applicable only after Nvidia's chips were available?

Is there a method for differentiating informative comments from commented out code?

What factors could lead to bishops establishing monastic armies?

Was it ever illegal to name a pig "Napoleon" in France?

Reference request: quantifier elimination test

Run Bash scripts in folder all at the same time

How does one acquire an undead eyeball encased in a gem?

Why do airports remove/realign runways?

Writing an ace/aro character?

Appropriate conduit for several data cables underground over 300' run



How to fix Error Number: 1054 Unknown column 'Array' in 'where clause'


Unknown Column In Where ClauseError: Unknown column 'Array' in 'where clause'How to fix “Headers already sent” error in PHPPassing 2 strings through array to the where clause in codeigniterUnknown column 'Array' in 'where clause' SQL=SELECT * FROM #__content WHERE Array = '4'Multiple search field codeigniter database error unknown column 'array' in 'where clause'Running query inside loopError when trying to fetch data from a database using CodeIgniterError Number: 1054 Unknown column in where clauseError while executing Query in Codeigniter






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















this is my error :




A PHP Error was encountered Severity: Notice Message: Array to string
conversion Filename: templates/sidebar.php Line Number: 24 Backtrace:



File:
A:SitesPHP_CIhasan-loginapplicationviewstemplatessidebar.php
Line: 24 Function: _error_handler



File: A:SitesPHP_CIhasan-loginapplicationcontrollersAdmin.php
Line: 14 Function: view



File: A:SitesPHP_CIhasan-loginindex.php Line: 315 Function:
require_once A Database Error Occurred



Error Number: 1054 Unknown column 'Array' in 'where clause'



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 = Array ORDER BY
user_access_menu.menu_id ASC



Filename: A:/Sites/PHP_CI/hasan-login/system/database/DB_driver.php
Line Number: 691




I use php codeigniter. but when I delete the part where the program runs smoothly. maybe an error in the where. how to fix this error?



this is my code :



<?php
//error_reporting(0);
$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;
?>









share|improve this question



















  • 3





    The first line tells you the problem, $role_id is an array and you are trying to use it as a string. You need to extract the appropriate value from it (perhaps $role_id[0] but without seeing more of your code it's impossible to tell) to use in your query.

    – Nick
    Mar 25 at 23:29

















1















this is my error :




A PHP Error was encountered Severity: Notice Message: Array to string
conversion Filename: templates/sidebar.php Line Number: 24 Backtrace:



File:
A:SitesPHP_CIhasan-loginapplicationviewstemplatessidebar.php
Line: 24 Function: _error_handler



File: A:SitesPHP_CIhasan-loginapplicationcontrollersAdmin.php
Line: 14 Function: view



File: A:SitesPHP_CIhasan-loginindex.php Line: 315 Function:
require_once A Database Error Occurred



Error Number: 1054 Unknown column 'Array' in 'where clause'



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 = Array ORDER BY
user_access_menu.menu_id ASC



Filename: A:/Sites/PHP_CI/hasan-login/system/database/DB_driver.php
Line Number: 691




I use php codeigniter. but when I delete the part where the program runs smoothly. maybe an error in the where. how to fix this error?



this is my code :



<?php
//error_reporting(0);
$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;
?>









share|improve this question



















  • 3





    The first line tells you the problem, $role_id is an array and you are trying to use it as a string. You need to extract the appropriate value from it (perhaps $role_id[0] but without seeing more of your code it's impossible to tell) to use in your query.

    – Nick
    Mar 25 at 23:29













1












1








1








this is my error :




A PHP Error was encountered Severity: Notice Message: Array to string
conversion Filename: templates/sidebar.php Line Number: 24 Backtrace:



File:
A:SitesPHP_CIhasan-loginapplicationviewstemplatessidebar.php
Line: 24 Function: _error_handler



File: A:SitesPHP_CIhasan-loginapplicationcontrollersAdmin.php
Line: 14 Function: view



File: A:SitesPHP_CIhasan-loginindex.php Line: 315 Function:
require_once A Database Error Occurred



Error Number: 1054 Unknown column 'Array' in 'where clause'



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 = Array ORDER BY
user_access_menu.menu_id ASC



Filename: A:/Sites/PHP_CI/hasan-login/system/database/DB_driver.php
Line Number: 691




I use php codeigniter. but when I delete the part where the program runs smoothly. maybe an error in the where. how to fix this error?



this is my code :



<?php
//error_reporting(0);
$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;
?>









share|improve this question
















this is my error :




A PHP Error was encountered Severity: Notice Message: Array to string
conversion Filename: templates/sidebar.php Line Number: 24 Backtrace:



File:
A:SitesPHP_CIhasan-loginapplicationviewstemplatessidebar.php
Line: 24 Function: _error_handler



File: A:SitesPHP_CIhasan-loginapplicationcontrollersAdmin.php
Line: 14 Function: view



File: A:SitesPHP_CIhasan-loginindex.php Line: 315 Function:
require_once A Database Error Occurred



Error Number: 1054 Unknown column 'Array' in 'where clause'



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 = Array ORDER BY
user_access_menu.menu_id ASC



Filename: A:/Sites/PHP_CI/hasan-login/system/database/DB_driver.php
Line Number: 691




I use php codeigniter. but when I delete the part where the program runs smoothly. maybe an error in the where. how to fix this error?



this is my code :



<?php
//error_reporting(0);
$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;
?>






php where-clause where-in mysql-error-1054






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 25 at 23:27









Nick

48.2k14 gold badges24 silver badges44 bronze badges




48.2k14 gold badges24 silver badges44 bronze badges










asked Mar 25 at 23:26









Hasan ZahirHasan Zahir

254 bronze badges




254 bronze badges







  • 3





    The first line tells you the problem, $role_id is an array and you are trying to use it as a string. You need to extract the appropriate value from it (perhaps $role_id[0] but without seeing more of your code it's impossible to tell) to use in your query.

    – Nick
    Mar 25 at 23:29












  • 3





    The first line tells you the problem, $role_id is an array and you are trying to use it as a string. You need to extract the appropriate value from it (perhaps $role_id[0] but without seeing more of your code it's impossible to tell) to use in your query.

    – Nick
    Mar 25 at 23:29







3




3





The first line tells you the problem, $role_id is an array and you are trying to use it as a string. You need to extract the appropriate value from it (perhaps $role_id[0] but without seeing more of your code it's impossible to tell) to use in your query.

– Nick
Mar 25 at 23:29





The first line tells you the problem, $role_id is an array and you are trying to use it as a string. You need to extract the appropriate value from it (perhaps $role_id[0] but without seeing more of your code it's impossible to tell) to use in your query.

– Nick
Mar 25 at 23:29












2 Answers
2






active

oldest

votes


















0














This is codeigniter, you can use the OOB functions given in codeigniter query builder page, by the way you should try this one:



 <?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` = ?
ORDER BY `user_access_menu`.`menu_id` ASC
";
$menu = $this->db->query($queryMenu,array($role_id))->result_array();
var_dump($menu);
die;
?>





share|improve this answer























  • Thank you so much this command worked for me : $menu = $this->db->query($queryMenu,print_r($role_id))->result_array();

    – Hasan Zahir
    Mar 25 at 23:50











  • Good job & good luck sir!

    – Jan Lois
    Mar 25 at 23:53


















0














use printr on the $role_id variable, i suspect its an array and this is why you are getting this error.






share|improve this answer























  • Thank you so much this command worked for me : $menu = $this->db->query($queryMenu,print_r($role_id))->result_array();

    – Hasan Zahir
    Mar 25 at 23:51













Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55347811%2fhow-to-fix-error-number-1054-unknown-column-array-in-where-clause%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














This is codeigniter, you can use the OOB functions given in codeigniter query builder page, by the way you should try this one:



 <?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` = ?
ORDER BY `user_access_menu`.`menu_id` ASC
";
$menu = $this->db->query($queryMenu,array($role_id))->result_array();
var_dump($menu);
die;
?>





share|improve this answer























  • Thank you so much this command worked for me : $menu = $this->db->query($queryMenu,print_r($role_id))->result_array();

    – Hasan Zahir
    Mar 25 at 23:50











  • Good job & good luck sir!

    – Jan Lois
    Mar 25 at 23:53















0














This is codeigniter, you can use the OOB functions given in codeigniter query builder page, by the way you should try this one:



 <?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` = ?
ORDER BY `user_access_menu`.`menu_id` ASC
";
$menu = $this->db->query($queryMenu,array($role_id))->result_array();
var_dump($menu);
die;
?>





share|improve this answer























  • Thank you so much this command worked for me : $menu = $this->db->query($queryMenu,print_r($role_id))->result_array();

    – Hasan Zahir
    Mar 25 at 23:50











  • Good job & good luck sir!

    – Jan Lois
    Mar 25 at 23:53













0












0








0







This is codeigniter, you can use the OOB functions given in codeigniter query builder page, by the way you should try this one:



 <?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` = ?
ORDER BY `user_access_menu`.`menu_id` ASC
";
$menu = $this->db->query($queryMenu,array($role_id))->result_array();
var_dump($menu);
die;
?>





share|improve this answer













This is codeigniter, you can use the OOB functions given in codeigniter query builder page, by the way you should try this one:



 <?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` = ?
ORDER BY `user_access_menu`.`menu_id` ASC
";
$menu = $this->db->query($queryMenu,array($role_id))->result_array();
var_dump($menu);
die;
?>






share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 25 at 23:34









Jan LoisJan Lois

1899 bronze badges




1899 bronze badges












  • Thank you so much this command worked for me : $menu = $this->db->query($queryMenu,print_r($role_id))->result_array();

    – Hasan Zahir
    Mar 25 at 23:50











  • Good job & good luck sir!

    – Jan Lois
    Mar 25 at 23:53

















  • Thank you so much this command worked for me : $menu = $this->db->query($queryMenu,print_r($role_id))->result_array();

    – Hasan Zahir
    Mar 25 at 23:50











  • Good job & good luck sir!

    – Jan Lois
    Mar 25 at 23:53
















Thank you so much this command worked for me : $menu = $this->db->query($queryMenu,print_r($role_id))->result_array();

– Hasan Zahir
Mar 25 at 23:50





Thank you so much this command worked for me : $menu = $this->db->query($queryMenu,print_r($role_id))->result_array();

– Hasan Zahir
Mar 25 at 23:50













Good job & good luck sir!

– Jan Lois
Mar 25 at 23:53





Good job & good luck sir!

– Jan Lois
Mar 25 at 23:53













0














use printr on the $role_id variable, i suspect its an array and this is why you are getting this error.






share|improve this answer























  • Thank you so much this command worked for me : $menu = $this->db->query($queryMenu,print_r($role_id))->result_array();

    – Hasan Zahir
    Mar 25 at 23:51















0














use printr on the $role_id variable, i suspect its an array and this is why you are getting this error.






share|improve this answer























  • Thank you so much this command worked for me : $menu = $this->db->query($queryMenu,print_r($role_id))->result_array();

    – Hasan Zahir
    Mar 25 at 23:51













0












0








0







use printr on the $role_id variable, i suspect its an array and this is why you are getting this error.






share|improve this answer













use printr on the $role_id variable, i suspect its an array and this is why you are getting this error.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 25 at 23:30









ChrisChris

7835 silver badges16 bronze badges




7835 silver badges16 bronze badges












  • Thank you so much this command worked for me : $menu = $this->db->query($queryMenu,print_r($role_id))->result_array();

    – Hasan Zahir
    Mar 25 at 23:51

















  • Thank you so much this command worked for me : $menu = $this->db->query($queryMenu,print_r($role_id))->result_array();

    – Hasan Zahir
    Mar 25 at 23:51
















Thank you so much this command worked for me : $menu = $this->db->query($queryMenu,print_r($role_id))->result_array();

– Hasan Zahir
Mar 25 at 23:51





Thank you so much this command worked for me : $menu = $this->db->query($queryMenu,print_r($role_id))->result_array();

– Hasan Zahir
Mar 25 at 23:51

















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55347811%2fhow-to-fix-error-number-1054-unknown-column-array-in-where-clause%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현