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.