when I am trying to upload image to the desired directory, I am getting an mysql error. I am able to upload the image, but the image name is not getting stored in the database. I am able to store other fields except image name.
Error: Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in C:\dev\akelos\lib\AkActiveRecord\AkDbAdapters\AkMysqlDbAdapter.php on line 80
print_r($this->params['photo']); produces the following the o/p:
Since the 'image_name' is of varchar type, and the 'image_name' is an array(show above), its showing the above mysql error. How can I solve this????
CommentAuthorKaste
hm, isn't
$this->params['photo']['image_name']['name']
what you're looking for?
CommentAuthorGKSR
thanx kaste,
I know that. I have set the value of image_name in my controller like this, $this->Photo->setAttribute('image_name', $this->params['photo']['image_name']['name']); Yet, its showing the same mysql error?