Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F11725004
WithMySQL.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
741 B
Referenced Files
None
Subscribers
None
WithMySQL.php
View Options
<?php
namespace
Keruald\Database\Engines
;
trait
WithMySQL
{
public
function
isExistingTable
(
string
$database
,
string
$table
)
:
bool
{
$escapedTable
=
$this
->
escape
(
$table
);
$sql
=
"SHOW TABLE STATUS
FROM `$database`
WHERE Name = '$escapedTable'"
;
return
$this
->
queryScalar
(
$sql
)
===
$table
;
}
public
function
isView
(
string
$database
,
string
$view
)
:
bool
{
$escapedView
=
$this
->
escape
(
$view
);
$escapedDatabase
=
$this
->
escape
(
$database
);
$sql
=
<<<EOF
SELECT TABLE_TYPE
FROM information_schema.tables
WHERE TABLE_SCHEMA = "$escapedDatabase" AND TABLE_NAME = "$escapedView"
EOF;
return
$this
->
queryScalar
(
$sql
)
===
"VIEW"
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Sep 18, 19:00 (4 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2991311
Default Alt Text
WithMySQL.php (741 B)
Attached To
Mode
rKDB Keruald Database
Attached
Detach File
Event Timeline
Log In to Comment