• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to get string from database and how to explode it in codeigniter?

#1
Here is my code i tried to explode string, but get some errors, i got string but i did not explode, Here i getting some erros,i cant understand it A PHP Error was encountered
Severity: Warning
Message: explode() expects parameter 2 to be string, object given
Filename: views/testing.php
Line Number: 65
Here is My code:

Code:
 <?php

                                   foreach ($test as $t)  
                               {
                                     echo  $user_rights=$t;
                                       $t=(explode(",", $t));                                  


                                   }

                                   ?>
Reply

#2
Is $test the DB query result?

In that case $t also needs database column - $t->user_rights
Reply

#3
(07-21-2018, 06:27 AM)Pertti Wrote: Is $test the DB query result?

In that case $t also needs database column - $t->user_rights

oh yes got it, Thank you
Reply

#4
(07-22-2018, 09:26 PM)jaydevvara Wrote: oh yes got it, Thank you

No worries Smile
Reply

#5
(07-23-2018, 12:28 AM)Pertti Wrote:
(07-22-2018, 09:26 PM)jaydevvara Wrote: oh yes got it, Thank you

No worries Smile
 just now i posted new question can you help me please?
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.