很抱歉要问一些广泛记录的内容,但我遇到了很多不同的方法,我非常非常困惑.
public staticpublic $fooglobal这似乎是一种糟糕的做法define()const constant = 'constant value';我低估了我在这里要做的事情的复杂性吗?
class MyClass
{
$foo = 'bar';
function DoStuff()
{
echo $foo;
}
} //MyClass
Run Code Online (Sandbox Code Playgroud) 您能告诉我此查询出了什么问题吗?我只是找不到错误,这使我发疯。
<?php
$query = "INSERT INTO atable (fortlaufend, vorname, nachname, land, email, caption1, caption2, caption3, caption4, caption5, datum)
VALUES (NULL,
" . mysql_real_escape_string($_POST[vorname]) . ",
" . mysql_real_escape_string($_POST[nachname]) . ",
" . mysql_real_escape_string($_POST[land]) . ",
" . mysql_real_escape_string($_POST[email]) . ",
" . mysql_real_escape_string($_POST[caption1]) . ",
" . mysql_real_escape_string($_POST[caption2]) . ",
" . mysql_real_escape_string($_POST[caption3]) . ",
" . mysql_real_escape_string($_POST[caption4]) . ",
" . mysql_real_escape_string($_POST[caption5]) . ",
CURRENT_TIMESTAMP)";
?>
Run Code Online (Sandbox Code Playgroud)
“ fortlaufend”是AUTO_INCREMENT的主要索引。mysql_error是
查询无效:您的SQL语法有误;检查与您的MySQL服务器版本相对应的手册以获取正确的语法,以在“名称,姓氏,国家/地区,电子邮件”附近使用,这使这张照片对您特别吗?,第3行
谢谢!