2020-12-26 20:09:15 +08:00
|
|
|
<?php
|
2021-06-08 10:42:39 +08:00
|
|
|
use Nexus\Database\NexusDB;
|
2020-12-26 20:09:15 +08:00
|
|
|
|
|
|
|
|
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);
|
2020-12-26 20:09:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function mysql_errno()
|
|
|
|
|
{
|
2021-06-08 10:42:39 +08:00
|
|
|
return NexusDB::getInstance()->errno();
|
2020-12-26 20:09:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function mysql_error()
|
|
|
|
|
{
|
2021-06-08 10:42:39 +08:00
|
|
|
return NexusDB::getInstance()->error();
|
2020-12-26 20:09:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function mysql_query(string $sql)
|
|
|
|
|
{
|
2021-06-08 10:42:39 +08:00
|
|
|
return NexusDB::getInstance()->query($sql);
|
2020-12-26 20:09:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function mysql_select_db($database)
|
|
|
|
|
{
|
2021-06-08 10:42:39 +08:00
|
|
|
return NexusDB::getInstance()->select_db($database);
|
2020-12-26 20:09:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function mysql_num_rows($result)
|
|
|
|
|
{
|
2021-06-08 10:42:39 +08:00
|
|
|
return NexusDB::getInstance()->numRows($result);
|
2020-12-26 20:09:15 +08:00
|
|
|
}
|
|
|
|
|
|
2020-12-28 02:14:41 +08:00
|
|
|
function mysql_fetch_array($result, $type = null)
|
2020-12-26 20:09:15 +08:00
|
|
|
{
|
2021-06-08 10:42:39 +08:00
|
|
|
return NexusDB::getInstance()->fetchArray($result, $type);
|
2020-12-26 20:09:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function mysql_fetch_assoc($result)
|
|
|
|
|
{
|
2021-06-08 10:42:39 +08:00
|
|
|
return NexusDB::getInstance()->fetchAssoc($result);
|
2020-12-26 20:09:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function mysql_fetch_row($result)
|
|
|
|
|
{
|
2021-06-08 10:42:39 +08:00
|
|
|
return NexusDB::getInstance()->fetchRow($result);
|
2020-12-26 20:09:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function mysql_affected_rows()
|
|
|
|
|
{
|
2021-06-08 10:42:39 +08:00
|
|
|
return NexusDB::getInstance()->affectedRows();
|
2020-12-26 20:09:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function mysql_real_escape_string($string)
|
|
|
|
|
{
|
2021-06-08 10:42:39 +08:00
|
|
|
return NexusDB::getInstance()->escapeString($string);
|
2020-12-26 20:09:15 +08:00
|
|
|
}
|
|
|
|
|
|
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
|
|
|
}
|