Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
349 views

We developed a CodeIgniter application using the PHP ActiveRecord ORM for the Query builder, and the application runs in a Docker container on an AWS server. We recently upgraded PHP from version 8.0 ...
Antoniraj's user avatar
  • 161
0 votes
1 answer
407 views

I am using phpactive record. To find all data from one table I am using like below $groups = GroupModel::all(); echo "<pre>"; print_r($groups); then getting output like Array ( [0] =>...
user3534476's user avatar
0 votes
0 answers
97 views

I'm working on a API with FlightPHP and PHPActiveRecord that returns an array of Reports optionally filtered through url query string parameters. $allowed = ['author' => 'author_id', 'owner' => ...
markusand's user avatar
  • 335
2 votes
1 answer
515 views

I really confused with the situation. I want to get data from function in my class, that created by ActiveRecord Model. Here a class: class Bag extends ActiveRecord\Model { static $table_name = "...
MrSmile's user avatar
  • 1,233
1 vote
0 answers
58 views

I am appending custom selects and table aliases into the query. Used {PRE} to append prefix to table names in the custom query but it was also adding the prefix to alias in select. if I add {PRE}...
Omar Abdullah's user avatar
1 vote
0 answers
77 views

I have the following table schema ( legacy system so I can't change it :-( ) admins: admin_id ... admin_auths: admin_id ( connects to admin_id ) id ( connects to user_id ) auth ( only care ...
Menachem Hornbacher's user avatar
0 votes
0 answers
37 views

How would one implement count with a group by operation using the PHP activerecord ORM? I know that I can do this directly via custom_sql, but I am looking for a way to do this more directly through ...
saladi's user avatar
  • 3,293
2 votes
1 answer
331 views

I'm currently in the process of replacing a self-made hack-y MVC approach's Model component with php-activerecord. I have a separate page that displays in the event that the database server goes down, ...
SeinopSys's user avatar
  • 8,938
1 vote
1 answer
55 views

I am working in a legacy system that uses row() plus limit() to get one result. I didn't understand why, because row() already give me one result, but a coworker said that improves performance. ...
capcj's user avatar
  • 1,535
0 votes
1 answer
70 views

I have so many combinations of conditions that could possibly go into a db call that I can't possibly make a separate call for each one. I'd have way too many if/else statements. So I wanted to ...
bjacobs's user avatar
  • 411
0 votes
3 answers
365 views

I am currently getting the following error in my User model. Slim Application Error The application could not run because of the following error: Details Type: ActiveRecord\...
Joseph Astrahan's user avatar
1 vote
1 answer
212 views

So I have just gone through a update going from CI 2.0.4 to 3.1.4 and ran into the issue with Sparks now being redundant I've had to move onto composer to get php active record working.. however I ...
Clint's user avatar
  • 11
0 votes
1 answer
182 views

i just get php active record or eloquen from laravel running on codeigniter. first attempt create model it's run well, but after that i got this following error: Type: Illuminate\Database\...
areiilla's user avatar
  • 109
1 vote
1 answer
409 views

I have a file index.php and in the same level I have a folder called models where I have my user model User.php I am trying to user php active-record library, so I downloaded the library and put it ...
medBouzid's user avatar
  • 8,546
1 vote
2 answers
70 views

I'm having a table whith 'id' as pk of type int. When I'm doing the folowing mysql query in php activerecord Location_cat::find_by_sql("select concat('#',id) as 'id', text FROM location_cat"); it ...
Alin Ungurean's user avatar
0 votes
1 answer
38 views

I need to make some redirects for some products which has been deleted from database. I get the product from database this way: public function show( $prod_id=null){ $produs=Product::find(...
Alex Suciu's user avatar
0 votes
1 answer
70 views

I got 2000, 1066, Not unique table/alias: 'category' this error. I very well know what the issue. My Code : static $belongs_to = array( array('Parent', 'foreign_key'=>'...
Parth Chavda's user avatar
  • 1,829
0 votes
2 answers
468 views

SELECT `db_name`.`view_name` . * FROM `db_name`.`view_name` Above query statement for View is not working. Below error occurred. #1051 - Unknown table 'view_name' Below query statements for Table ...
Jihun Lee's user avatar
1 vote
0 answers
73 views

I have a table column price FLOAT(10, 2) NOT NULL DEFAULT 0.00 And Model: class Mytable extends \ActiveRecord\Model{ static $table_name = 'my_table'; } In php i use $price = 23.54; $obj = new ...
Veniamin's user avatar
  • 467
2 votes
1 answer
491 views

I am trying to achieve something that should be simple but seems impossible in PHP ActiveRecord. In the simplified example I created, I have two models, Person and Exchange, and two tables, people(id,...
scozy's user avatar
  • 2,622
0 votes
1 answer
39 views

I have three tables, and I am using members to find all the tasks they have completed. class Task extends BaseModel { static $has_many = array( array('members', 'through' => 'member_tasks'), ...
Craig Ward's user avatar
  • 2,505
1 vote
1 answer
398 views

I have a database setup with a students table. The students table has a one to many relationship with a few other tables. ie a student can have multiple subjects. but also a student can have multiple ...
jamesmstone's user avatar
0 votes
0 answers
2k views

I have a mysql (version 5.6.24) with a table where one of the columns updated_at is a TIMESTAMP default CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP. I never needed to worry about this column as ...
bockzior's user avatar
  • 536
1 vote
3 answers
776 views

I'm trying to update the user details table using php activerecord but everytime I get this error ::save() cannot be invoked because this model is set to read only I can insert to the same table ...
Jacob's user avatar
  • 449
1 vote
1 answer
288 views

According to the documentation here (http://www.phpactiverecord.org/projects/main/wiki/Finders) There is a way to find records in the database like so below. # fetch all lousy romance novels which ...
Joseph Astrahan's user avatar
2 votes
2 answers
235 views

I'm using php-activerecord to manage my MySQL entries. The block of code where the problem ocurs is the following: $item->id = $result->id; $item->save(); var_dump($result->id); // ...
bockzior's user avatar
  • 536
12 votes
6 answers
2k views

I'm using php-activerecord for a short while now and i absolutely love it. Php-activerecord is an open source ORM library based on the ActiveRecord pattern. However, i recently tried to use it in ...
RTB's user avatar
  • 5,833
1 vote
1 answer
295 views

I'm using php-activerecord for a short while now and i absolutely love it. Php-activerecord is an open source ORM library based on the ActiveRecord pattern. However, i also like phpdoc and use that to ...
RTB's user avatar
  • 5,833
0 votes
0 answers
258 views

I have my php active record with the code like this: $app->get('/dailyReservationReport/request', function ($id=null) { $status_code = 200; $resp = array('status'=>'success','message'=>'...
Lee Lee's user avatar
  • 583
1 vote
1 answer
1k views

I'm trying to use Active Record methods to update a table and flag a task as complete like this: $this->db->update('tasks', array('status' => 'complete')) ->where('id', $...
whiteatom's user avatar
  • 1,455
0 votes
1 answer
1k views

I am not able to get my broswer to display an image from the database(stored as blob). I have tried header("Content-type: image/jpeg"); echo ''; But it is still not able to display on the browser. ...
joseph chai's user avatar
0 votes
1 answer
548 views

How to use phpactiverecord memcached? anyone can help me? $database = array( 'connection' => 'local', 'local' => 'mysql://username:password@localhost/database?charset=utf8', '...
Tiara Larasati's user avatar
0 votes
1 answer
986 views

I had a small problem when using PHP ActiveRecord, every project i always change 3 file : Column.php, Model.php, Connection.php and replace Y-m-d H:i:s T to Y-m-d H:i:s How to change it easy ?? ...
Tiara Larasati's user avatar
1 vote
1 answer
221 views

So I use two main libraries for PHP project right now: php-activerecord and slim micro framework. I am also a user of vagrant and puppet cause I like keeping thing in sync. The one thing with this ...
nerdlyist's user avatar
  • 2,855
0 votes
1 answer
411 views

I am using php-activerecord in my Codeigniter project, I have a 2 tables in my database, questions table and answers table associated in a One to many relationship, When I delete a question like this ...
Sam  Karanja's user avatar
0 votes
1 answer
203 views

I just started to use the PHP ActiveRecord class and get along with it quiet well but now I'm stuck by trying to associate a user with a group, and a group with many users. This is what I've got: ...
ThatMSG's user avatar
  • 1,506
0 votes
1 answer
97 views

I'm trying to find all rows that have an end_time greater than the current time. In MySQL I believe I can use: SELECT * FROM Table WHERE end_time > DATE(NOW()); So, I'm trying to use: $options = ...
sahbeewah's user avatar
  • 2,690
1 vote
1 answer
61 views

I have the following validator function. static $validates_size_of = array( array('contactfirstname' , 'within' => array(1,50), 'allow_null' => true), array('contactlastname'...
Joseph Astrahan's user avatar
0 votes
1 answer
546 views

Trying to get to grips with slim framework and phpactive record. Have searched the docs, here and google to no avail and tried several things. I would like to retrieve all items from a table where a ...
Bernie Davies's user avatar
0 votes
1 answer
45 views

Let's say I have a Screenshot model with a date column which defines when the screenshot was taken. I also have a GameVersion model with start_date and end_date instance methods defining the beginning ...
TonyRaccoon's user avatar
0 votes
1 answer
723 views

Is there a way to get all the column names, and then figure out what type the column is? For example, ENUM, VARCHAR, TINYINT, etc..., in particular for ENUM the different components of the ENUM? I ...
Joseph Astrahan's user avatar
0 votes
1 answer
834 views

I can't figure out how to get all datas (rows and columns) from a mysql resultset. With this code i get not all rows from the my query : $row=1; $column = 'A'; $sql = "SELECT distinct c.code, p....
achillix's user avatar
  • 497
0 votes
1 answer
374 views

I am trying to transform my sql query in a phpactiverecord query. But it doesn't works. I get this error message: Fatal error: Uncaught exception 'ActiveRecord\DatabaseException' with message '...
achillix's user avatar
  • 497
0 votes
1 answer
64 views

I am learning to use Slim framework and Twig. I want to know if it is possible to kind of multi-purpose a template. Consider this; I want to make a form to add a job for a client, if you access via ...
Bernie Davies's user avatar
1 vote
0 answers
134 views

This is my many to many relation class Post extends ActiveRecord\Model { static $table_name = 'app_post'; static $has_many = array( array('postcategory'), array('category', '...
user3619463's user avatar
0 votes
1 answer
319 views

I must be missing something important but I can't sort this thing out I would like to associate many addresses to a person so ... here we go with my settlement: Is there anyone to help? CREATE TABLE `...
Stephane G's user avatar
1 vote
1 answer
660 views

Can anyone please tell me what is the problem in using the not in condition in the following code: $filter=implode(',',array(1,2)); $list = static::all(array('conditions' => array('org_grp_id = ? ...
zakaria's user avatar
  • 436
0 votes
1 answer
70 views

I'm trying to figure out how to model the following in PHPActiveRecord, but am getting stuck and wanted to see if someone could help me out. I'll use a simplified example: Table List: atable (id [PK]...
rchawdry's user avatar
  • 1,286
1 vote
1 answer
392 views

I have a PHP ActiveRecord model in which I have a function that requires the number of rows a query will return. I obtain the number of rows using the built in static::count($conditions) function. ...
user3087867's user avatar
1 vote
0 answers
61 views

I am using CodeIgniter + phpActiveRecord. I am getting all the records from the $_POST array and I want to send that same array to my activeRecord class to insert the data into the DB. This line ...
Gonzalo's user avatar
  • 355