Files
nexusphp/nexus/Database/helpers.php

68 lines
1.3 KiB
PHP
Raw Normal View History

<?php
2021-06-08 10:42:39 +08:00
use Nexus\Database\NexusDB;
function mysql_connect($host, $username, $password, $database, $port)
{
2021-06-08 10:42:39 +08:00
return NexusDB::getInstance()->connect($host, $username, $password, $database, $port);
}
function mysql_errno()
{
2021-06-08 10:42:39 +08:00
return NexusDB::getInstance()->errno();
}
function mysql_error()
{
2021-06-08 10:42:39 +08:00
return NexusDB::getInstance()->error();
}
function mysql_query(string $sql)
{
2021-06-08 10:42:39 +08:00
return NexusDB::getInstance()->query($sql);
}
function mysql_select_db($database)
{
2021-06-08 10:42:39 +08:00
return NexusDB::getInstance()->select_db($database);
}
function mysql_num_rows($result)
{
2021-06-08 10:42:39 +08:00
return NexusDB::getInstance()->numRows($result);
}
2020-12-28 02:14:41 +08:00
function mysql_fetch_array($result, $type = null)
{
2021-06-08 10:42:39 +08:00
return NexusDB::getInstance()->fetchArray($result, $type);
}
function mysql_fetch_assoc($result)
{
2021-06-08 10:42:39 +08:00
return NexusDB::getInstance()->fetchAssoc($result);
}
function mysql_fetch_row($result)
{
2021-06-08 10:42:39 +08:00
return NexusDB::getInstance()->fetchRow($result);
}
function mysql_affected_rows()
{
2021-06-08 10:42:39 +08:00
return NexusDB::getInstance()->affectedRows();
}
function mysql_real_escape_string($string)
{
2021-06-08 10:42:39 +08:00
return NexusDB::getInstance()->escapeString($string);
}
2020-12-28 20:52:54 +08:00
function mysql_insert_id()
{
2021-06-08 10:42:39 +08:00
return NexusDB::getInstance()->lastInsertId();
2020-12-28 20:52:54 +08:00
}
2021-01-07 17:35:00 +08:00
function mysql_free_result($result)
{
2021-06-08 10:42:39 +08:00
return NexusDB::getInstance()->freeResult($result);
2021-01-07 17:35:00 +08:00
}