开发者

result return in zend

I am writing query like this in zend but I am not getting return result in controller file, then what I have to do for this.

    $result=$db->query("insert into geofences (`name`,`description`,`polygon`,  
       开发者_如何学编程               `created_timestamp`,`company_id`)
                       values ('".$formData ['name']."',
                       '".$formData['description']."',  
                       GeomFromText('POLYGON(($polygon))'),
                       now(),'".$formData ['company_id']."')
                     ");

    return $result;


after a query() statment you have to fetch the results (if you have a SELECT, SHOW, DESCRIBE and EXPLAIN statement).... i think it uses the standard mysqli classes of PHP! In your case (an insert statement) you have no result to fetch...i think (i'm not sure but i think this is the case) that it returns true on success and false if the query fails.

Look here and here for reference

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜