简体   繁体   中英

CodeIgniter Active Record doesn't work on server but locally does,

Same code, Same DB. but in my local machine it works perfectly and in the remote server it writes:

Parse error: syntax error, unexpected '[' in /var/www/html/cms-beacons/application/modules/beacons/models/beacons_model.php on line 53

(Basically this means that I don't have results that I must have in this situation)

My local machine is connected remotley to the server DB and the server is connected to its localhost.

this happends where I'm using CI active record, like that:

$getBlockTypeQuery = $this->db->select('Type')->from('blocks')->where('ID', $blockID)->get();

BUT! when I'm using normal syntax it works fine.

$query = $this->db->query('SELECT Active FROM `stores` WHERE ID = '. $storeID );

Just to make it clear: My machine: Active record and normal query syntax works Server: Active record doesn't work, normal query syntax works

Any suggestions how you investigate this problem? Thanks.

Since you have regular sql query that works well (+ it is faster than Active record), i don't see why would you like to find a solution and waste time (my opinion). Active record is just easier to use for some people but it consumes a lot of memory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM