Php learning diary

Source: Internet
Author: User
Php learning log 1. the php file is the same as the database code, and the page is still garbled. After checking, it turns out that utf8 and UTF-8 are the problem .???? Mysql_connect ("localhost", "root", "root ");???? Mysql_query ("setna php learning log

1. the php file is consistent with the database encoding, and the page is still garbled. After the check, it turns out that utf8 and UTF-8 are the problem.

???? Mysql_connect ("localhost", "root", "root ");

???? Mysql_query ("set names uft-8;"); replace with mysql_query ("set names utf8 ");

?

2. I have a basic understanding of mysql_fetch_array, mysql_fetch_row, mysql_fetch_assoc, and mysql_fetch_object.

??? A. You can use the mysql_fetch_array function to obtain the value through the key name (field name) and number key. For example, $ row ["user"] and $ row [0]

??? B. mysql_fetch_row can only obtain field values through the number key. For example, $ row [0]

??? C. mysql_fetch_assoc obtains the value through $ row ["user "].

??? D. mysql_fetch_object treats each record as an object, and each field is equivalent to the attribute of this object.

???????? How to get the value: $ row-> user.

?

3. the smarty installation fails.

???? After decompression, you also need to set folder permissions such as config and templates.

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.