我不断收到此错误:
Warning: mysql_query() [function.mysql-query]: Access denied for user 'mcabinet'@'localhost' (using password: NO) in /home/mcabinet/public_html/games/db_edit/airportmadness4.php on line 3
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/mcabinet/public_html/games/db_edit/airportmadness4.php on line 3
No Database found.
这是我的整个 .php 页面:
<?php
include("../templates/base/template2/mysql_connect.php");
$gametitle = "Airport Madness TEST";
$gamedescription = "DESCRIPtion testing a description. LOL !";
$image1url = "http://website-gamesite.com/games/images/lhfdsjk.jpg";
$categorycode = "adv";
$gametitle2 = "airportmadnesstest";
mysql_query("INSERT INTO Games VALUES (null,'$gametitle','$gamedescription','$image1url','$categorycode','0','$gametitle2'") or die ("Error Inserting Values into the Games Table");
?>
谢谢!我刚开始使用 PHP 和 MySQL。
编辑:这是包含文件的内容:
<?php
$db_host = "localhost";
$db_username = "mcabinet_admin";
$db_password = "4jf8ido9A";
$db_name = "mcabinet_games";
@mysql_connect($db_host,$db_username,$db_password) or die ('MySQL Not found // Could Not Connect.');
@mysql_select_db("$db_name") or die ("No Database found.");
?>
使用您的提示进行编辑后,我仍然收到错误消息。
编辑:我做了更多的改变。这很奇怪,因为当我从数据库中获取内容时,内容显示正常,但仍然显示错误。当我运行单独的脚本,尝试添加行时,它甚至不会连接。