The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fetch data from DB
#1
Dear UserSpice Team ,

I am a newbie to user spice and just started working on PhP MYSQL . of course i love to work in this for the reason it gives me flexibility to make changes on the top of your framework without any restriction .

My query is i need to display the role of the user logged in . Like if he is Administrator then echo as Administrator

I am taking Permission id of the logged in user from users table and comparing it with the id in Permission table and trying to fetch the name of the role from the permission table . But it displays the following error .

<pre>
Code:
Notice: Array to string conversion in C:\xampp\htdocs\***\account.php on line 477
Array
</pre>


My code is as follows

<pre>
Code:
<?php
  $query =$db->query("select name from permission where permission.id=users.permissions");
  $results = $query->results();
  echo $results;
?>
</pre>
  Reply


Messages In This Thread
Fetch data from DB - by jjmmrg - 03-13-2016, 01:51 PM
Fetch data from DB - by jjmmrg - 03-14-2016, 02:51 AM
Fetch data from DB - by jjmmrg - 03-14-2016, 03:15 AM
Fetch data from DB - by jjmmrg - 03-14-2016, 04:31 AM
Fetch data from DB - by brian - 03-14-2016, 01:10 PM
Fetch data from DB - by mudmin - 03-14-2016, 02:05 PM
Fetch data from DB - by brian - 03-14-2016, 02:12 PM
Fetch data from DB - by jjmmrg - 03-15-2016, 03:16 AM
Fetch data from DB - by jjmmrg - 03-15-2016, 03:20 AM
Fetch data from DB - by jjmmrg - 03-15-2016, 04:37 AM
Fetch data from DB - by brian - 03-15-2016, 01:19 PM
Fetch data from DB - by jjmmrg - 03-16-2016, 03:17 AM
Fetch data from DB - by jjmmrg - 03-16-2016, 09:06 AM
Fetch data from DB - by brian - 03-16-2016, 12:21 PM
Fetch data from DB - by astropos - 03-16-2016, 04:25 PM
Fetch data from DB - by mudmin - 03-17-2016, 12:03 AM
Fetch data from DB - by brian - 03-17-2016, 03:07 PM
Fetch data from DB - by jjmmrg - 03-18-2016, 02:54 AM
Fetch data from DB - by jjmmrg - 03-18-2016, 02:55 AM
Fetch data from DB - by jjmmrg - 03-18-2016, 02:56 AM
Fetch data from DB - by jjmmrg - 03-18-2016, 03:31 AM
Fetch data from DB - by mudmin - 03-18-2016, 12:54 PM
Fetch data from DB - by jjmmrg - 03-19-2016, 03:51 AM
Fetch data from DB - by mudmin - 03-19-2016, 04:41 PM
Fetch data from DB - by jjmmrg - 03-21-2016, 08:19 PM
Fetch data from DB - by mudmin - 03-21-2016, 10:54 PM
Fetch data from DB - by jjmmrg - 03-22-2016, 02:56 AM
Fetch data from DB - by jjmmrg - 03-22-2016, 02:58 AM
Fetch data from DB - by mudmin - 03-22-2016, 04:41 AM
Fetch data from DB - by jjmmrg - 03-22-2016, 04:43 AM
Fetch data from DB - by jjmmrg - 03-22-2016, 11:35 AM
Fetch data from DB - by jjmmrg - 03-22-2016, 11:58 AM
Fetch data from DB - by mudmin - 03-22-2016, 01:49 PM
Fetch data from DB - by jjmmrg - 03-22-2016, 01:56 PM
Fetch data from DB - by mudmin - 03-22-2016, 02:20 PM
Fetch data from DB - by jjmmrg - 03-22-2016, 03:44 PM
Fetch data from DB - by brian - 03-22-2016, 04:02 PM
Fetch data from DB - by brian - 03-22-2016, 04:33 PM
Fetch data from DB - by brian - 03-22-2016, 04:50 PM
Fetch data from DB - by mudmin - 03-22-2016, 05:19 PM

Forum Jump:


Users browsing this thread: 7 Guest(s)