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;
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
FROMuser_menu
JOIN
user_access_menu
ONuser_menu
.id
=user_access_menu
.menu_id
WHEREuser_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
add a comment |
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
FROMuser_menu
JOIN
user_access_menu
ONuser_menu
.id
=user_access_menu
.menu_id
WHEREuser_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
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
add a comment |
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
FROMuser_menu
JOIN
user_access_menu
ONuser_menu
.id
=user_access_menu
.menu_id
WHEREuser_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
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
FROMuser_menu
JOIN
user_access_menu
ONuser_menu
.id
=user_access_menu
.menu_id
WHEREuser_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
php where-clause where-in mysql-error-1054
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
add a comment |
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
add a comment |
2 Answers
2
active
oldest
votes
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;
?>
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
add a comment |
use printr on the $role_id variable, i suspect its an array and this is why you are getting this error.
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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;
?>
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
add a comment |
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;
?>
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
add a comment |
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;
?>
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;
?>
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
add a comment |
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
add a comment |
use printr on the $role_id variable, i suspect its an array and this is why you are getting this error.
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
add a comment |
use printr on the $role_id variable, i suspect its an array and this is why you are getting this error.
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
add a comment |
use printr on the $role_id variable, i suspect its an array and this is why you are getting this error.
use printr on the $role_id variable, i suspect its an array and this is why you are getting this error.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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