Why don't I write code, bro?

Source: Internet
Author: User
Why can't I write code?
Add an exam

PHP Code:
if ($_get[' Do ']== ' add ') {
Include Dedeinclude (' templets/student/student_voice_add.htm ');
$id = $_post[' username ');
$email = $_post[' email '];
$content = $_post[' content '];
$time = Date (' y-m-d h:i:s ');
$category = $_post[' category '];
$flag = $_post[' flags '];
$flags =implode (",", $flag);
$checked = $_post[' checked ');
echo $id. "
". $email."
". $content."
". $time."
". $category."
". $flags."
". $checked;
$sql = "INSERT into Djs_skstudent_voice (username, content, time, category, checked, email, flag) VALUES (' $id ', ' $content ', ' $time ', ' $category ', ' $checked ', ' $email ', ' $flags ');
$dsql->executenonequery ($sql);

can be added. But he will add a blank for all values. Then it's what you want to add. Which means he's going to do it first. All SQL with null values. What is this?

Share to: more


------Solutions--------------------
Before executing, output SQL to see

$sql = "INSERT into Djs_skstudent_voice (username, content, time, category, checked, email, flag) VALUES (' $id ', ' $content ', ' $time ', ' $category ', ' $checked ', ' $email ', ' $flags ');

Die ($sql);
------Solutions--------------------
Click the link is get mode
$_post arrays cannot have values
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.