Questions tagged [medoo]

A lightweight PHP framework for dealing with database interaction

Medoo is lightweight single file framework, optimized for higher performance to increase the development and user experience for PHP development projects with SQL database need.

It supports following php_pdo Extensions:

  • MySQL, MariaDB - php_pdo_mysql
  • MSSQL (Windows) - php_pdo_sqlsrv
  • MSSQL (Liunx/UNIX) - php_pdo_dblib
  • Oracle - php_pdo_oci
  • SQLite - php_pdo_sqlite
  • PostgreSQL - php_pdo_pgsql
  • Sybase - php_pdo_dblib

It requires php_pdo_xxx extension to be enabled and recommends PHP 5.4+ with PDO support. However it works with PHP 5.1+

92 questions
2
votes
2 answers

Medoo PHP framework - 'select' 'left join' using 'and' to test against a condition (as in col = val)

I'm trying to make a left join select and use AND to compare a column against a specific value, i.e. a condition. The problem is I don't know where to add the condition. The below medoo query returns the first shirt id of the same user id even if…
biko
  • 510
  • 6
  • 15
2
votes
1 answer

Medoo PHP Framework and joining multiple tables

Trying to join 3 tables: leagues, leagues_teams, and teams. With the query: $teams = $database->select( 'teams', [ '[>]leagues_teams' => [ 'fifa_id' => 'fifa_team_id' ], '[>]leagues' => [ …
2mas
  • 127
  • 2
  • 14
2
votes
2 answers

Medoo, short ajax syntax

I have problem with Medoo framework, all work fine on localhost (php > 5.4+) but on my server I have instaled PHP 5.3+, can you help me how I can convert this code to old array version and execute code on PHP 5.3. platform. $database = new medoo…
user3300811
  • 105
  • 1
  • 1
  • 7
1
vote
0 answers

suggest a way to make key in medoo

I use medoo as database framework and I add caching using redis but there is a problem with it . I create key like this blow : public function select(string $table, $join, $columns = null, $where = null): ?array { $redisKey =…
1
vote
0 answers

Should I change IDs in DB if I change order of list of times from DB

I list of tasks. Everyone task has Id in DB. Id column has setted up autoincrement. I made this list sortable via jquery by sortable() function from jquery ui. Now if I change order of times I change order of Id in DB. But bcz of UPDATE does not…
Dump
  • 237
  • 1
  • 12
1
vote
2 answers

Is there IN() function in Medoo?

Lets say I have this piece of code: $this->database->debug()->select( 'client', [ 'id', 'name', 'phone', 'email', 'address' ], …
dydx
  • 157
  • 15
1
vote
0 answers

Slim Framework 4 - Using $this when not in object (Medoo Framework) PHP

I have updated my project based on Slim Framework to Slim 4 today. I'm working with the Medoo (database framework) here. https://medoo.in/api/collaboration Here the Slim integration is explained: use Medoo\Medoo; $container =…
DavDeveloper
  • 261
  • 1
  • 17
1
vote
0 answers

MySQL Medoo force datatype

I'm currently trying to get rows from my MySQL DB in a specific order. Therefore, I found a query like this useful: SELECT * FROM tbl_items WHERE id IN (130,129) ORDER BY FIELD(ID, 130,129) When I run this directly in MySQL, everything is working…
nameless
  • 1,483
  • 5
  • 32
  • 78
1
vote
0 answers

How to auto populate jquery ajax with select2

I want to my select2 after succes they populate other field . I am using medoo framework . this is my code : $('.matrix').select2({ ajax: { url: "index.php", dataType: 'json', data: function (params,page)…
1
vote
1 answer

How to Ajax with select2 auto fill another input field

please your help ,how to auto fill with ajax + select2 using medoo framework database to autofill another input in same form . this my ajax code : $('.matrix').select2({ ajax: { url: "index.php", dataType: 'json', data:…
1
vote
2 answers

Medoo echo values from Select

Using Medoo how do I echo the values from the select query currently this is what I am doing using the example from the docs. $data = $database->select('names', [ 'name','nameId' ], [ 'nameId' => 50 ]); echo json_encode($data); the result…
Abu Nooh
  • 846
  • 4
  • 12
  • 42
1
vote
1 answer

How to compare two columns instead of values using medoo framework

I want to compare two columns of medoo rather its values. $issues = $database->select("issues","*",[ "AND" => [ "projectid" => 1, "estimated_hrs[<]" => "timespent" ] ]); But getting an error while doing…
EvilsEmpire
  • 146
  • 2
  • 13
1
vote
1 answer

Fatal error: Class 'medoo' not found

I am using slim framework 2 with medoo via composer, i am making singleton for medoo but when i call the medoo class to configure my db info, so it gives me the fatal error like below Fatal error: Class 'medoo' not found in…
lazyCoder
  • 2,544
  • 3
  • 22
  • 41
1
vote
1 answer

Error doing a Full Outer Join

product table: ╔══════════════════════════════════╦═══════════╦═══════════════════╦════════════════════╦════╗ ║ ref ║ mfr ║ pnum ║ ssku ║ id…
eozzy
  • 66,048
  • 104
  • 272
  • 428
1
vote
1 answer

best way to error handling in medoo

best way to handling error in medoo insert query or other query The code in all queries properly. For example, when multiple records insert whid insert() method output is an array. 1: try{ $db->pdo->beginTransaction(); …
PersianMan
  • 924
  • 1
  • 12
  • 29