Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12740275
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
Sun, Nov 16, 12:55 (1 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3123962
Default Alt Text
WithMySQL.php (741 B)
Attached To
Mode
rKERUALD Keruald libraries development repository
Attached
Detach File
Event Timeline
Log In to Comment