我正在尝试在一个正在使用的网站上使用此简单查询,但是它没有在数据库中插入任何数据!

<?php
// Include database configuration
include('../config.php');

// Include ezSQL core
include_once "ezSQL/ez_sql_core.php";

// Include ezSQL database mysql component
include_once "ezSQL/ez_sql_mysql.php";

// Initialise database object and establish a connection
$db = new ezSQL_mysql($db_user,$db_pass,$db_database,$db_host);

$the_file = "video.mp4";
$the_image = "image.jpg";
$the_title = "Title";
$the_description = "lokr dry ceyrc cetcn cebtyn cetbny rnyfb rybrnr rybynum nyr";
$the_anime = "Anime";
$the_genre = "Genre";
$the_slug = "anime";

$db->query("INSERT INTO video (file, image, title, description, anime, genre, slug) VALUES ($the_file, $the_image, $the_title, $the_description, $the_anime, $the_genre, $the_slug)");

$db->debug();

?>


请在这里帮我一下!

最佳答案

由于您要插入的值是字符串,因此应尝试执行以下操作:

$db->query("INSERT INTO video (file, image, title, description, anime, genre, slug) VALUES ('$the_file', '$the_image', '$the_title', '$the_description', '$the_anime', '$the_genre', '$the_slug')");

关于php - 此ezSQL查询有什么问题?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/16871526/

10-09 05:05