PHP code example of dandylion / advancedmedoo

1. Go to this page and download the library: Download dandylion/advancedmedoo library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dandylion / advancedmedoo example snippets


$database->select(
    'user',
    '[>]post'=>'user_id'
    [
        'user.name'
        'post.*'
    ]
);
//[{
//    "name": "my_name",
//    "user_id": 1,
//    "text": "post_text"
//    "date": "01/01/1970"
//}]

/* You can also put text in brackets to prepend a string in front of all the columns incase of duplicate column names */

$database->select(
    'user',
    '[>]post'=>'user_id'
    [
        'user.name'
        'post.* (post_)'
    ]
);

//[{
//    "name": "my_name",
//    "post_user_id": 1,
//    "post_text": "post_text",
//    "post_date": "01/01/1970"
//}]