user663878
user663878

Reputation: 2383

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;

Upvotes: 0

Views: 108

Answers (1)

Nicola Peluchetti
Nicola Peluchetti

Reputation: 76870

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

Upvotes: 1

Related Questions