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
0
votes
1 answer

How to use strpos with Medoo query

I wrote this function to retrieve the homepage of the website link recorded in stats based on STRPOS but Medoo is throwing an error. function getSiteAuthor($string) { if ($string) { $result = db::query("SELECT id, http FROM users WHERE…
WilliamK
  • 821
  • 1
  • 13
  • 32
0
votes
2 answers

PHP Page Blank - Not understanding scopes

So, simply put, I feel like this code should work. Literally at this moment I am just trying to create a PHP class that takes in some information and runs a command against the database. I know the command works so it's not that, it something to do…
Entevily
  • 38
  • 5
0
votes
0 answers

How to write a medoo INNER JOIN query correctly? Not getting any results despite the SQL query its based on working

I'm writing an interface for a database using medoo and I'm trying to use INNER JOIN when executing a query: $this->db->select("oc_t_item_description", [ //join "[><]oc_t_item" => ["fk_i_item_id" => "pk_i_id"] ], [ //columns …
not_this_again
  • 131
  • 3
  • 7
0
votes
1 answer

pass function with argument to method call

I'm trying to use flight PHP framework for routing and medoo framework for database usage. //connect database $database = new medoo([ 'database_type' => 'sqlite', 'database_file' => 'db.sqlite' ]); //my function function…
0
votes
1 answer

How to get last inserted in database in Medoo framework

Please help me am not able to get the last inserted Id in medoo Below is my code:
lazyCoder
  • 2,544
  • 3
  • 22
  • 41
0
votes
1 answer

Fatal error: Call to a member function fetchAll() on a non-object

Fatal error: Call to a member function fetchAll() on a non-object in **************/includes/Dbo.class.inc on line 41 Line 41: public function selectCondition($database, $table, $condition, $condition_value){ return…
user5600054
0
votes
3 answers

sql select all users from table X which are not in comination on table Y

I'm fairly new to sql and am trying to get data from table X when the user is not in table Y with the combination of player id and world id AND the player access is 2. Let me explain a little furter: Table X (user…
Xiduzo
  • 897
  • 8
  • 24
0
votes
1 answer

Mysql getting all joined records both tables

I'm using a great php framework for working with my database, medoo.php. Link to medoo docs for reference: http://medoo.in/doc What I Want To Happen: Return all records from joined tables, where it matches one or more conditions from a right…
turnfire
  • 35
  • 5
0
votes
3 answers

Medoo MySQL not reading variable

I'm using the Medoo MySQL framework but ran into this issue when using IN within a WHERE statement: $test = '1,2,3,4'; $count = $database->count("products", [ "AND" => [ "category_id" => $category['id'], "id" => [$test] …
0
votes
1 answer

How to get SQLSRV on Xampp working with Medoo?

I got a PHP project which uses Medoo for accessing a database on MS SQL Server 2012. I used to test my project on the same server, but since copy-pasting through remote desktop got kinda annoying and inefficient, I wanted to move on a local system,…
StrikeAgainst
  • 556
  • 6
  • 23
0
votes
1 answer

SUM row field MEDOO

I am trying to get a summed field in medoo. My sql at the moment is like: $database->debug()->select("user_rupees_in_house", [ "[<]rupees" => ["rupee_id" => "ID"] ], [ "name", "amount", "amount_spend" ], [ "user_uuid" => $user, …
Xiduzo
  • 897
  • 8
  • 24
0
votes
3 answers

Date comparison between MSSQL varchar and PHP string does not work - why?

So I got a database running on a Microsoft SQL Server 11, with the table hpfc_prices containing multiple entries in a chronologic sequence, which roughly looks like this: |date (varchar(255))|time (varchar(255))|price…
StrikeAgainst
  • 556
  • 6
  • 23
0
votes
2 answers

PHP Converting a PDO Object into array and echo foreach

I'm using the Medoo database Framework. The following query returns a PDO object. $datas=$database->query(' SELECT lethal_servers.LETHAL_ServerName AS "lethal_servers LETHAL_ServerName", lethal_servers.LETHAL_ServerID AS…
Stanley Machnitzki
  • 597
  • 1
  • 4
  • 11
0
votes
1 answer

Medoo WHERE clause multiple conditions

How to write this sql query in medoo? select * from users where name='John' and age=35? I tried it like, select('users','*',["AND"=>["name[=]"=>"John","age[=]"=>35]]); The above query returns an array when data is found and returns a boolean…
Sean
  • 21
  • 3
0
votes
1 answer

How to escape default behaviour of Medoo table prefixing in Select query with joining

I want to replicate this MySQL query in medoo framework in PHP SELECT col1,col2 FROM table1 t1 LEFT JOIN table2 t2 ON t1.col1 = t2.col4 AND t1.col2=1; This is what i can come up with $database->select("table1",[ …
firecast
  • 988
  • 2
  • 10
  • 20