这个ezSQL查询有什么问题?(What is wrong with this ezSQL query?)

编程入门 行业动态 更新时间:2024-10-28 14:26:09
这个ezSQL查询有什么问题?(What is wrong with this ezSQL query?)

我试图在我正在处理的网站上使用这个简单的查询,但它没有将任何数据插入数据库!

<?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(); ?>

请帮帮我一点!

I am trying to use this simple query on a website I am working on but it is not inserting any data into the database!

<?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(); ?>

Please help me a bit here!

最满意答案

因为您要插入的值是字符串,您应该尝试这样的事情:

$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')");

since the values that you want to insert are strings you should try something like this:

$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')");

更多推荐

本文发布于:2023-07-30 23:29:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1340277.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:有什么   ezSQL   query   wrong

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!