1 | $sql = "INSERT INTO typecho_contents( title, created, modified, text, authorId, allowComment, allowPing, allowFeed )VALUES ('秘密#$mimiId', '$mimitime', '$mimitime', '$mimicontent', '1', '1', '1', '1');INSERT INTO typecho_relationships(cid, mid) VALUES ('$mimiId', '1')" ;
|
ログイン後にコピー
これは機能しません。エラー メッセージは次のとおりです。エラー: SQL 構文にエラーがあります。'INSERT INTO typecho_relationships(cid, mid) 2行目のVALUES ( '23', '1')'
1文書いたら1文だけ実行 以下の2文をデータベース内で直接実行すれば成功します。
1 | INSERT INTO typecho_contents( title, created, modified, text, authorId, allowComment, allowPing, allowFeed )VALUES ( '秘密#23' , '147852369' , '147852369' , '为什么' , '1' , '1' , '1' , '1' );INSERT INTO typecho_relationships(cid, mid) VALUES ( '23' , '1' )
|
ログイン後にコピー
ディスカッションへの返信(解決策)
1 | $sql1 =mysql_query( "INSERT INTO typecho_contents( title, created, modified, text, authorId, allowComment, allowPing, allowFeed )VALUES ('秘密#$mimiId', '$mimitime', '$mimitime', '$mimicontent', '1', '1', '1', '1')" ); $sql2 =mysql_query( "INSERT INTO typecho_relationships(cid, mid) VALUES ('$mimiId', '1')" );
|
ログイン後にコピー
に変更すると成功します