Tagged Questions
2
votes
1answer
47 views
Codeigniter : How to make the nested selection for related tables
I have two tables in my database one for "LOUNGES" and one for "CITIES". There isn't an explicit connection between them. I mean I haven't put a column "city_id" in the "LOUNGES TABLE". I just take ...
0
votes
1answer
23 views
Mysql left outer join column does not exist - CodeIgniter DataMapper ORM
I'm running the following query, which is being generated by CodeIgniter's DataMapper ORM as I try to query a deep relationship of the form order_product/order/order_status:
SELECT `order_products`.*
...
0
votes
2answers
21 views
CodeIgniter DataMapper ORM memory issue
I am using CodeIgniter and DataMapper to manage relationships for an ecommerce store. The relationships are:
A product has many skus
A product has many amazon_products
A sku has many amazon_products
...
1
vote
2answers
42 views
Codeigniter: How to make a desc order between 3 tables?
So I am using CodeIgniter and DataMapper. I made something like a wall where you can view articles link posts image posts. This are 3 different tables and each one of them have column called ...
0
votes
0answers
41 views
CI Datamapper ORM complex count related
For the first time, I'm using a datamapper for a CodeIgniter project.
I have a table products, in which I store my items.
There is a table categories, that specifies the kind of item.
And a table ...
0
votes
1answer
180 views
Datamapper with codeigniter save many to many relationship
I have three table company,group and company_group.
I am getting values from post while saving a company.
In my company form i have multiple select box which has a list of group.
My company is ...
0
votes
1answer
93 views
CI Datamapper: Iterate parent child
I have categories and posts.
I would like to list all categories (parent), and all related posts (child). Without nested sets, complex queries. Relations setted up.
As i rembember from the ...
0
votes
1answer
75 views
Many-To-Many relationship save fails
I have this Many-To-Many relation:
These are my Models:
Productvariant
class Productvariant extends DataMapper {
var $has_many = array('propertyvalue');
var $has_one = array('product');
...
0
votes
1answer
247 views
DataMapper ORM simple OneToMany relationship
This is the start of my relational model;
I don't to use DataMapper's redundant way of having a relational table for everything, but yet I can't seem to;
Code
<?php
$brand = new Brand(1);
...
0
votes
2answers
114 views
codeigniter and DataMapper. The relationship table in different servers, how?
I hope you can understand me. My English is bad, but not for long.
This error I describe has never happened, the truth is very rare.
In my local machine works perfectly, windows and wamp work :(.
But ...
0
votes
0answers
95 views
Returing null value using all_to_array in codeignitor
I was facing a problem with all_to_array. Its returning a null value.
$object_self = new self();
$response = $object_self->
select('DATE(`created_at`) as ...
1
vote
2answers
169 views
Joining tables in different databases with the CI DataMapper ORM
I did search for a solution, but found nothing helpfull. This question was about using multiple databases with datamapper but I already use that method.
user model:
class User extends DataMapper {
...
1
vote
1answer
39 views
Combined results from relationship in WanWizard datamapper orm?
I have a relationship that is setup like so:
a user has multiple roles
a role has multiple modules
Hence, a user has all modules that their roles have
Basically what I want to do is given the user ...
0
votes
1answer
430 views
Codeigniter multiple database connect slow
In one of my codeigniter project I want to connect multiple databases. I connected to multiple and its working fine.
Its a renewal - big project. Means need to restructure and fetch data from ...
0
votes
2answers
204 views
DataMapper ORM relationships
table1(users)
|ID|name |type |
|1 |demo |admin |
|2 |demoX |client|
table2(visits)
|ID|admin_id|visitor_id|visit_date|...
|1 |1 |2 |2013-01-01|...
admin(fk)->users(id)
...
-1
votes
1answer
309 views
Datamapper ORM save data in join table [closed]
I am currently working an application with Code Igniter and Datamapper ORM and I am trying to save data in the database. I have two tables which have a many to many relationship between eachother. For ...
0
votes
1answer
367 views
How to get table values ​​using array and conditions
I'm studying and decided to make a CodeIgniter application with backend and frontend for learning purposes and I came across the following doubts.
Would you like to get all data from a table in the ...
0
votes
3answers
775 views
Does CodeIgniter Datamapper ORM support a MySQL CASE statement in ORDER BY clauses?
Using Datamapper 1.8.1-dev for PHP's CodeIgniter, I'm trying to build this query to prioritize one country name at top of the list:
SELECT * FROM countries
ORDER BY CASE name WHEN 'Australia' THEN 1 ...
1
vote
1answer
95 views
Dynamically accessed URL is not the same url stored in the database in CodeIgniter
I am creating a cms where an user can upload an url with title. These URLs and titles, I am accessing dynamically in my front page of the website.
Suppose if I uploaded an url : www.google.com and ...
0
votes
1answer
69 views
getting difficulty in generating the Dyanmic checkbox from the database
I am using Codeigniter and Datamapper for DB Query. My controller is as follows
function fetch_interested_in()
{
$in = new Interested_in();
$in -> get();
$interested_in = ...
3
votes
1answer
715 views
CodeIgniter DataMapper ORM unable to instantiate model object
I am creating a model object like this: $object1 = new Object1(); There is a table in the database named object1s. The Object1 class is an empty class that extends DataMapper. That works without ...
1
vote
1answer
2k views
Is CodeIgniter DataMapper slow? [closed]
I have been working on a relational data base with Codeigniter and found out that DataMapper is useless for serious project. Codeigniter's Active record is useless as it is not providing a many to ...
0
votes
1answer
404 views
Translate an SQL query using ISNULL into Datamapper ORM for Codeigniter
I have 3 mySQL tables: user, section and user_section (a joining table).
The SQL below:
SELECT id, description,
NOT ISNULL(
(SELECT user_id
FROM user_section
WHERE ...
2
votes
1answer
656 views
Find duplicate records with advanced query in CodeIngniter Datamapper
I'm trying to get all duplicate rows from a DB. Lets say I have table entries with primary key id ant VARCHAR column called name. I already have a working SQL query:
SELECT id, entries.name FROM ...
2
votes
1answer
929 views
How to nest WHERE params in Datamapper ORM for Codeigniter?
I am having trouble with a specific query, using Datamapper ORM for Codeigniter. My data model is set up so that I have blog posts, each of which have many categories, users, and tags. I want to fetch ...
2
votes
1answer
189 views
Selecting rows that corresponds from other table
I have a product table that stores all products. Also I have a production table that stores productions.
I am using CodeIgniter and datamapper ORM.
Here is tables:
CREATE TABLE IF NOT EXISTS ...
4
votes
3answers
911 views
DataMapper ORM for Codeigniter Relations
I have a table ...
CREATE TABLE IF NOT EXISTS `messages` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`to` int(11) NOT NULL,
`from` int(11) NOT NULL,
`subject` varchar(50) NOT NULL,
`message` ...
4
votes
2answers
2k views
CodeIgniter DataMapper ORM v1.8.0 - How to Get records from multiple tables
I am new to this and need a little help. I have a 2 tables...
CREATE TABLE `vehicles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`vehicle_type` varchar(50) NOT NULL,
`vehicle_make` varchar(50) NOT ...
0
votes
1answer
1k views
Codeigniter Datamapper save() not actually saving to database
I'm running CodeIgniter 1.7.3, Datamapper DMZ 1.7.1 (and no, upgrading is not an option), MySQL 5.1, and the Cron Job Boostrapper for an application I'm building. I'm attempting to extract information ...
2
votes
2answers
754 views
Datamapper (Overzealous Edition), Codeigniter and Has Many Clarification
Firstly, I would like to just it out there that I am an ORM noob. I've never used an ORM in my life and have reached a point in my day-to-day developing that I need to do some crazy advanced ...
0
votes
1answer
482 views
MySQL Query problem in CodeIgniter
So I'm using the following:
$r = new Record();
$r->select('ip, count(*) as ipcount');
$r->group_by('ip');
$r->order_by('ipcount', 'desc');
$r->limit(5);
...