• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Array to string conversion

#1
Hi!

I have little problem with my script. I getting error:
PHP Code:
SeverityNotice

Message
: Array to string conversion

Filename
V_panel/wydarzenia.php

Line Number
56 

Here is full script:
PHP Code:
function pobierz_wpisy_kalendarza$rok$miesiac )
 {
 
 
$query $this->db->select'date''data' )
 
 ->from'kalendarz' )
 
 ->like'date'"$rok-$miesiac"'after' )
 
 ->get();

 
$wpisy = array();

 foreach ( 
$query->result() as $row ) {
 
$wpisy[substr($row->date,8,2)] = $row->data;
 }

 return 
$wpisy;

 } 

This is bad line:
PHP Code:
<?php echo $wpisy?>
so this is only echo for variable, so something is wrong in model (UP).
Reply

#2
PHP basics you CAN'T echo array...
Use print_r($wispy); instead..
Best VPS Hosting : Digital Ocean
Reply

#3
So i getting now:
PHP Code:
Array ( ) 
Reply

#4
It seems that there are no results to your query.

Log your query with $this->db->last_query();
you can add it to $wispy['query']= $this->db->last_query(); After you have runned the select..

And see what is the generated query ..
Best VPS Hosting : Digital Ocean
Reply

#5
... $this->db->select( 'date, data' ) ...
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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