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
I might be wrong, but doesn't require_once 'medoo.min.php'; require parentheses? like so: require_once ('medoo.min.php');
Try this, its likely to work
<?
require_once 'medoo.min.php';
use Medoo\Medoo; //If this line raises errors, remove it
// Initialize DB
$database = new Medoo(
// required
'database_type' => 'mysql',
'database_name' => 'name',
'server' => 'localhost',
'username' => 'your_username',
'password' => 'your_password',
);
$email = $database->get('MM_Users', 'Email', [
'ID' => 1
]);
return $email;
}
?>
One other bug I noticed is that you instantiated a the Medoo object (in other words, you called the Medoo class) using a Lowercase M of which shouldn't be the case. In addition remember to pass in the correct Database & Server values.
See this for more info if you're still facing challenges on that.
This line:
require_once('signin.php');
is inside a class but outside a method, which is not possible in PHP.
You can't have require_once
inside a class without a function.
That's the main reason.
Try putting the require_once
in the construct
.
To be exact :
class foo
{
require_once('bar.php');
}
will throw an error.