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
1
vote
3 answers

How to count values with different where clauses on the same column?

I hate that I have to ask but I just cant handle it. I have this table votes: type=1 is an upvote, type=0 would be a downvote I want this output: [ {'video': 'best-of-mehrwert', 'upvote': 2, 'downvote': 0}, {...} ] I am using…
Alex
  • 9,911
  • 5
  • 33
  • 52
1
vote
1 answer

Strict standards: Declaration of DatabaseAccess::get() should be compatible with medoo::get($table, $join = NULL, $column = NULL, $where = NULL)

I am encountering this error when trying to run a site using WAMP. But it works fine on my LAMP VM. The parent function has this signature: public function get($table, $join = null, $column = null, $where = null) { And it is extended like so: class…
stefanhorne
  • 1,619
  • 3
  • 16
  • 23
1
vote
2 answers

SELECT ALL with Medoo

I have just started using Medoo, and it seems that it's impossible to perform SELECT * FROM users in a simple way. I have tried using $result = $db->select("users","*"); as the official documentation suggests, but this returned an error: Warning:…
FiddlingAway
  • 1,598
  • 3
  • 14
  • 30
1
vote
0 answers

medoo error return null data

I am using medoo to handle table operations. And now I cannot debug via error() function of medoo at http://medoo.in/api/error. Here is my test table structure: CREATE TABLE [user] ( [id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, [username]…
Gary Liu
  • 13
  • 4
1
vote
1 answer

SQL query via Medoo taking too long to finish

My script allows you to upload a zip file and then inserts the individual file information into a database using Medoo, after extracting them. My script takes way too long to finish, even after I've set the max execution time to 5 minutes I get the…
Henry A.
  • 391
  • 2
  • 19
1
vote
1 answer

Medoo - Select issue

Im just starting out building an app with Medoo, Im trying to run a select query looking like this $datas = $database->debug()->select( "table", ["id","password"], ["email" => "johndoe@emailaddress.com"] ); When i run this it uses the…
Callum
  • 42
  • 9
1
vote
1 answer

Php Medoo update vs replace

I do not understand why there is replace method in the Medoo class. What is difference between this and a update call?
Tobia
  • 9,165
  • 28
  • 114
  • 219
1
vote
1 answer

Medoo PHP Framework Using AND

I am using the Medoo Framework for a project. I've only started using it so I'm not totally up to speed with exactly how it works. Anyway, I'm trying to run a simple query that uses SELECT and AND. However, as far as I can see the Medoo website…
Mike
  • 13
  • 5
1
vote
4 answers

Php Error - Unexpected require_once expecting function

I'm currently trying to fetch the medoo framework so that I can begin easily retrieving data from my MySQL database... and for some reason it doesn't work! here's the code of my signin.php file
muffinjello
  • 158
  • 1
  • 5
  • 16
0
votes
0 answers

How to use descending order in Medoo?

I have this table: Given a patient name, I want to fetch a row with the highest id, which is: Agus Maryono - 10 - F - 11 - 2023-01-13 17:08:07 The SQL query to do that is: SELECT nama_pasien, uid_pasien, kode, id, estimasi_dilayani FROM…
anta40
  • 6,511
  • 7
  • 46
  • 73
0
votes
0 answers

ORDER BY sort by then from smallest to largest in medoo

How to write this query with medoo? query="SELECT DISTINCT id FROM items WHERE name='Mag' AND var='Bl' ORDER BY atrow +0 ASC" In the query results above, they are sorted according to the atrow values from the smallest to the largest Can anyone…
0
votes
1 answer

MySQL sort by 0 and then from smallest to largest in medoo

I am trying to do a mysql sort that displays 0 first and then by the smallest number. $query = "SELECT DISTINCT id FROM `items` WHERE `name`='Mag' AND `var`='Bl' ORDER BY atrow + 0 ASC" How to write it in medoo? $item = $database->select("items",…
0
votes
1 answer

Php Medoo select query

I need help with Medoo SQL query to select and display data of both columns on the below table but whenever I run my query only 1 row is returned is instead two, here's my query: $database->select("chat_messages", "*", [ "AND" => ["to_user_id"…
0
votes
1 answer

How To Use Medoo Database In Codeigniter 4

I couldn't find the solution and the correct way to call a Medoo class to use in codeigniter 4. I could run it in codeigniter 3, but not codeigniter 4. Below my error : And this is my code : File 1 (Dennis_layout_center) : namespace…
Dennis Liu
  • 2,268
  • 3
  • 21
  • 43
0
votes
1 answer

Use order with MEDOO

I'm trying to use order by, I want to use this select: Select * from tarea where cod_tarea = $row order by estado; $tarea_data = $database->select("tarea","*",['cod_tarea' => $row], ["ORDER" => "estado"]); $tarea_data =…
Zano
  • 15
  • 6