Welcome Guest, Not a member yet? Register   Sign In
A PHP Error was encountered : Invalid argument supplied for foreach()
#1

[eluser]vvva_avvv[/eluser]
Can you help me?.. I try to use query standard multiple result(object) in my update function. I can get data from my database initialy with this foreach() but when I update my data, it can't work then It will appear error message like this:

A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: guest/superieur_guest.php
Line Number: 31

I'm confused. There isn't trouble when I update.I mean my database updated successful. But why foreach() can read my database after that.Please help me :cheese:
#2

[eluser]WanWizard[/eluser]
Can you show us the code? Guessing isn't my strongest point...
#3

[eluser]vvva_avvv[/eluser]
Thank you.. it have solved Smile Can you help me again? I try to upload image in some folder. I have created folder uploads in root.
function do_upload()
{
$config['upload_path'] = '../uploads/';
$config['allowed_types'] = 'gif|jpg|png|jpeg';
$config['max_size'] = '200';
$config['max_width'] = '300';
$config['max_height'] = '300';

$this->load->library('upload', $config);

if ( ! $this->upload->do_upload('file'))
{
$error = array('error' => $this->upload->display_errors());

$this->load->view('signup', $error);
}
else
{
$data = array('upload_data' => $this->upload->data());
$data['main'] = 'signup_successful';
$this->load->view('superieur',$data);

}
}

It execute signup_successful but I can't find the image in my folder. It still empty. Please help me..why it can't work... thanks for your help Wink
#4

[eluser]daelsepara[/eluser]
perhaps, the permissions of the ../uploads directory is at fault?. it must be 777.




Theme © iAndrew 2016 - Forum software by © MyBB