2017-07-27 5 views
0

Keine Antworten wurden bei google gefunden und Stackoverflow Der Code ist wie folgtPHP Fatal error: Call to undefined function pdo_query()

<?php 
pdo_query("CREATE TABLE IF NOT EXISTS `ims_cyl_vip_video` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
`uniacid` int(5) NOT NULL, 
`title` varchar(255) NOT NULL, 
`uid` varchar(25) NOT NULL, 
`openid` varchar(255) NOT NULL, 
`time` varchar(15) NOT NULL, 
`video_url` text NOT NULL, 
`share` int(3) NOT NULL, 
`yvideo_url` text NOT NULL, 
`type` VARCHAR(25) NOT NULL, 
`index` int(2) NOT NULL, 
`video_id` int(11) NOT NULL, 
UNIQUE KEY `id` (`id`) 
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; 

CREATE TABLE IF NOT EXISTS `ims_cyl_vip_video_member` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 
    `uniacid` int(10) NOT NULL, 
    `openid` varchar(255) NOT NULL, 
    `uid` varchar(25) NOT NULL, 
    `nickname` varchar(255) NOT NULL, 
    `avatar` varchar(1000) NOT NULL, 
    `end_time` varchar(15) NOT NULL, 
    `is_pay` int(2) NOT NULL, 
+3

"* .. Bei google und stackoverflow * wurden keine Antworten gefunden". OK. Dann, Woher hast du 'pdo_query()'? –

+0

http://php.net/manual/de/pdo.query.php –

+0

Ich weiß nicht, wo ich pdo_query() bekommen kann – mlx

Antwort

0

Ich glaube, Sie versuchen, eine Tabelle mit PHP zu erstellen. Hier ist das einfache Codebeispiel, aus dem Sie die Tabellen erstellen können: Ersetzen Sie die Beispielabfrage durch Ihre SQL-Abfrage.

<?php 
$servername = "localhost"; 
$username = "username"; 
$password = "password"; 
$dbname = "myDB"; 

// Create connection 
$conn = new mysqli($servername, $username, $password, $dbname); 
// Check connection 
if ($conn->connect_error) { 
    die("Connection failed: " . $conn->connect_error); 
} 

// sql to create table 
$sql = "CREATE TABLE MyGuests (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, 
firstname VARCHAR(30) NOT NULL, 
lastname VARCHAR(30) NOT NULL, 
email VARCHAR(50), 
reg_date TIMESTAMP 
)"; 

if ($conn->query($sql) === TRUE) { 
    echo "Table MyGuests created successfully"; 
} else { 
    echo "Error creating table: " . $conn->error; 
} 

$conn->close(); 
?> 
+0

Ich weiß eigentlich nicht, wie spezifischer Code, mit jemand anderem CMS öffnen install.php diesen Fehler. Die PHP-Version ist 5.6.1 – mlx

+0

OP fragt eindeutig nach PDO. Warum würdest du eine Antwort mit mysqli geben? – Chris

+0

@Chris OP ist verwirrt über PDO und fügte den rohen Code auch ein, er hat ein wenig Wissen über PHP. Ich gab ihm eine einfache Lösung, die er annahm. –

Verwandte Themen