Tag Archives: database

CakePHP ACL Database Setup: ARO / ACO structure?

Questions: I’m struggling to implement ACL in CakePHP. After reading the documentation in the cake manual as well as several other tutorials, blog posts etc, I found Aran Johnson’s excellent tutorial which has helped fill in many of the gaps. His examples seem to conflict with others I’ve seen though in a few places –… Read More »

Codeigniter active records query taking too much time to load data from database

Questions: I’m using codeigniter This is my model <?php class groups_Model extends CI_Model { public function __construct(){ parent::__construct(); } /** * get All groups * @return array object list of groups */ public function get(){ $this->db->select(‘groups.id,groups.name as group,status.name as status’); $this->db->from(‘groups’); $this->db->join(‘status’, ‘status.id = groups.status’); $this->db->order_by(‘groups.id’, ‘ASC’); $this->db->limit($this->config->item(‘per_page’),$this->uri->segment(4)); $query = $this->db->get(); $total = $query->num_rows(); if($total… Read More »

Combining several database table together?

Questions: I have two tables tour_foreign&tour_foreign_residence in database and want merger this two table together that get output from PHP code as following example: My tables and values it: I want get as output tour_foreign.id = tour_foreign_residence.relation : One-week tour of Istanbul_1 | 88888 & 99999 $ 112233 $ 445566 | Three nights and two… Read More »

Unable To fetch data from database to script tag while using graph

Questions: plotOptions: { column: { pointPadding: 0.2, borderWidth: 0 } }, series: [{ name: ‘Not Completed’, data: [<?php echo json_encode($TotalNotCompleted); ?>] /* here how to write query to fetch data from database, to make my graph work dynamically */ }, { name: ‘Completed’, data: [<?php echo json_encode($TotalCompleted); ?>] }] Answers:

Accessing DataBases from different servers

Questions: I have a network of websites hosted on two different servers, server1 and server2. I need to be able to access the data stored in a MySQL DataBase on server1 from a PHP script in a site hosted on server2. Say a user registers on site1 on server1 and his data is inserted into… Read More »