No results are returned when php connects to the mysql database to execute SQL statements! Rescue

Source: Internet
Author: User
No results are returned when php connects to the mysql database to execute SQL statements! When a newbie first came into contact with the connection operation between php and mysql databases, he imitated the following code in the book and found that he could connect to the database, but the SQL statement was always not executed, the SQL statement is okay. it can be successfully executed in phpMyAdmin, but it won't work here. please try again and see what the problem is.
    


Reply to discussion (solution)

What is the error?

What is output by the program?

The program does not report an error, but the database is not successfully inserted.

What is the error?

Add an empty string to the output error.

What is output by the program?

Haha, sorry, I made an oolong myself. I didn't give this user permission in my mysql database, so I couldn't modify the database. it would be nice after I gave the permission. thank you!

What is output by the program?

    
Try it like this.

If ($ result) {echo "OK ";}
Else die ('Error: '. mysqli_error ());
Mysqli_close ($ connID );

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.