Questions tagged [notorm]

NotORM is a PHP library for data access based on PDO.

NotORM (Not ORM, i.e. Not Object Relational Mapping) is a PHP library for data access based on PDO and released under Apache or GPL license.

37 questions
6
votes
2 answers

Need a simple ORM or DBAL for existing PHP app

I am working on extending an existing PHP application. Unfortunately for me, the existing app is a mess. It's all spaghetti code with raw mysql_* calls. Groan. No way that I am going to do that in the parts that I am extending. So, I am looking for…
Sander Marechal
  • 22,978
  • 13
  • 65
  • 96
4
votes
1 answer

NotORM's join vs multiple selects

I was looking at this PHP DB library called NotORM and upon reading its docs, I have read about its stand on joins. The argument was basically the performance of a single SQL query with joins vs. using multiple select queries and then…
Noel Llevares
  • 15,018
  • 3
  • 57
  • 81
3
votes
7 answers

NotORM: How to fetch data?

I´m having trouble using selects, I tried reading the documentation but it's not too clear, and the forums that talk about it are few and inactive. I want to do a simple select, so I tried: $applications = $NOTORM->user_types() …
luqita
  • 4,008
  • 13
  • 60
  • 93
2
votes
0 answers

Make own JOIN statement with NotORM

I use NotORM library for smoother way to work with DB. But I can't get JOIN work as I want. I want to make a query like this: SELECT blog.*, COUNT(blog_post.id) AS total FROM blog LEFT JOIN blog_post ON blog_post.blog_id = blog.id…
Patrik Krehák
  • 2,595
  • 8
  • 32
  • 62
2
votes
2 answers

Selecting distinct column values in NOTORM

My MySQL table look like this: 'id' 'name' 'type' 1 name1 A 2 name2 B 3 name3 A 4 name4 C 5 name5 C How can I get all distinct types i.e A,…
sahil solanki
  • 507
  • 6
  • 20
2
votes
1 answer

How do I JOIN one-to-many tables using NotORM lib

i'm using NotOrm lib for working with data in the database. I have to follow the instructions here http://www.sitepoint.com/database-interaction-made-easy-with-notorm/ but did not solve my problem Here is my data structure: Tables -members …
2
votes
2 answers

Debugging NotORM Call Results in "Use of undefined constant STDERR - assumed 'STDERR'"

I am debugging a project that uses Slim and NotORM on PHP 5.4. When setting NotORM to debug mode the NotORM trace statement: fwrite(STDERR, "$backtrace[file]:$backtrace[line]:$debug\n"); throws the following error: "Use of undefined constant…
Toaster
  • 1,911
  • 2
  • 23
  • 43
1
vote
1 answer

NOTORM how to know sql query

in notorm documentation we know to get sql query use (string) $table but i didn't get any result when use it. $data = array('name'=>'testing','age'=>'25') $result = $db->table->insert($data); echo (string) $result ; i know the query is insert into…
Dedi Ananto
  • 144
  • 2
  • 14
1
vote
0 answers

NOTORM Join returns null

i ran into a problem with my Slim - Rest - API and the only thing that remains are question marks above my head. I joined several tables allready in my API which was working fine: // Detail View of Task $app->get('/task_detail/:id', function($id)…
w9nder
  • 31
  • 4
1
vote
1 answer

How to debug NotORM

Does anyone know a way to debug NotORM's requests? I am able to get the SQL query it executes by printf-ing the NotORM object. Example: $models = $this->dbh->wh_product()->select("wh_model.id, wh_model.manufacturer, wh_model.model, wh_model.details,…
mrteo
  • 11
  • 3
1
vote
1 answer

Get total comments of article in PHP with NotORM

My table ofcomments looks like: | ID | article_id | user_id | ... |-------------------------------| | 1 | 1 | 1 | ... | 2 | 2 | 2 | ... | 3 | 2 | 1 | ... | 4 | 3 | 2 | ... AndI need to…
Patrik Krehák
  • 2,595
  • 8
  • 32
  • 62
1
vote
1 answer

Delete query with conditions in NotORM

How can I implement the below query using pdo notorm? mysql_query("DELETE FROM table WHERE (down-up)>=some value AND id=$id"); I know the below statement will delete the selected row with id of value $id. But I am confused on, how can I check the…
SRG
  • 75
  • 1
  • 8
1
vote
4 answers

Slim response-headers returning text/html instead of application/json

I am fairly new to Slim and so far have had no trouble -- everything has worked as expected, until this issue. I've searched and searched, but I must not be looking in the right place. I'm using AngularJS with Slim and NotORM. So far I've got user…
user1362339
  • 39
  • 1
  • 3
1
vote
1 answer

Declare a delete statement in NotORM

How to declare a Delete statement in NotORM like this code: mysql_query("DELETE FROM pspaym WHERE F4='$d' ");
1
vote
1 answer

How do I JOIN many-to-many tables using NotORM

I'm learning NotORM to produce a simple system for school. I want to be able to award 'Pledges' to 'students'. Here is my data structure: My tables: students -studentid (PK) -firstname -surname -dateofbirth -vmg -yeargroup link -linkid…
1
2 3