Hongmu Notes
mysqli in PHP

mysqli in PHP Language Notes PHP PHP collection PHP and mysql

The `mysqli_num_rows()` function is exclusively used with `SELECT` query methods, whereas the `mysqli_affected_rows()` function returns the number of rows affected by the previous SQL statement across the entire database; this function is primarily used with `INSERT`, `UPDATE`, and `DELETE` operations.
👁 146
Summary of PHP integer division and rounding methods

Summary of PHP integer division and rounding methods Language Notes PHP

Four commonly used methods for applying the `intval` integer conversion function in PHP: 1. Direct truncation – discards the fractional part and retains the integer: `intval()`; 2. Rounding – rounds the number to the nearest integer: `round()`; 3. Ceiling – rounds the number up by adding 1 if it has a fractional part: `ceil()`; 4. Floor – rounds the number down to the nearest integer: `floor()`. I. `intval` – Converts a variable to an integer type; if the argument is a string, it is automatically converted to 0. Example: `intval(3.14159);`...
👁 146
php generate random numbers/generate random strings

php generate random numbers/generate random strings Language Notes PHP

Apply MD5 encryption to the timestamp and extract a portion of it: <?php function token($length){ $str = md5(time()); $token = substr($str, 5, $length); return $token;} echo token(6);?>
👁 159
Empire CMS batch extracts the first picture of the news text content as a SQL statement for the title thumbnail

Empire CMS batch extracts the first picture of the news text content as a SQL statement for the title thumbnail Program Notes Empire cms

Please back up your database before running the following script! The "News Body Text" field stored in the text file is not available! To use the "News Body Text" field as the primary table, use the following SQL statement: `UPDATE phome_ecms_news SET titlepic = CONCAT(Replace(SUBSTRING_INDEX(SUBSTRING_INDEX(newstext, '"src...`
👁 150
Implementation of php caching function

Implementation of php caching function Language Notes PHP

Different websites require varying caching functionalities; some only need to cache the requested GET parameters, while others require caching the entire URL. Below is a commonly used caching code snippet that has already been written. Caching code: `<?php // Cache storage directory define('CACHE_ROOT', dirname(__FILE__). '/');`
👁 209
The use of custom fields in Empire Navigation

The use of custom fields in Empire Navigation Program Notes Empire cms

[e:loop={&quot;select classid,classname from {$dbtbpre}enewsclass where bclassid=0 and showclass=0 order by myorder,classid desc&quot;,0,24,0}] &lt;?p…
👁 248
PHP filectime() function

PHP filectime() function Language Notes PHP

Definition and Usage: The `filectime()` function returns the last modification time of a specified file. This function checks both the daily modification history of the file and the inode modification status. The inode modification status refers to changes in permissions, ownership, user group, or other metadata. If successful, the function returns the last modification time of the file in Unix timestamp format; if unsuccessful, it returns `FALSE`.
👁 143
PHP mysqli

PHP mysqli Language Notes PHP PHP collection PHP and mysql

Execute a database query: Delete database; <br/>?php // Assume database username: root, password: 123456, database name: RUNOOB; $con = mysqli_connect('localhost', 'root', '123456', 'RUNOOB...');
👁 232
php function explode

php function explode Language Notes PHP

After retrieving the text content from the form's textarea input field, use the `explode(' rn', $str)对字符串内容进行分割, 发现rn,n,r都无法分割.使用PHP_EOL常量却正常分割成为数组.$arr = explode(PHP_EOL, $str);` function.
👁 132
PHP solve json

PHP solve json Language Notes PHP

Solution 1: Use the urlencode and urldecode methods to bypass the header transformation process (headers: 'Content-Type: application/json; charset=utf-8'); $arr = array 'lang' => urlencode 'I speak Chinese'...
👁 183
1 306 307 308 309 310 315

🔥 Popular articles

Empire CMS smart label call field collection

Empire CMS smart label call field collection Program Notes Empire cms

Collect and classify all fields that support smart tag calls into Empire CMS smart tags: [e:loop={column ID/topic ID, number of items displayed, operation type, only display pictures with titles, additional SQL conditions, display sorting}] Template code content [/e:loop] Calling time: <?=date('m-d',$bqr[newstime])?> <?=dat…
👁 3750
Imperial cms imitation website tutorial corresponding notes

Imperial cms imitation website tutorial corresponding notes Program Notes Empire cms

Hello everyone, welcome to learn the imperial cms imitation website tutorial. I am Hong Mu qq1810216796 QQ exchange group: 9589723231 Imperial cms website installation. Hello everyone, welcome to learn the imperial cms imitation website tutorial. I am Hong Mu qq: 1810216796 qq exchange group: 958972323 Build an imperial program. If you have a server and have built an imperial website on the server, then...
👁 3413
Empire cms7.5 payment upgraded and optimized version of the library sample automatically generates word/PDF documents paid copy download with payment system member center whole site template source code sitemap Baidu push + installation tutorial 014

Empire cms7.5 payment upgraded and optimized version of the library sample automatically generates word/PDF documents paid copy download with payment system member center whole site template source code sitemap Baidu push + installation tutorial 014 Practical Collection empire template

This set of templates has a complete member center on mobile and PC. The member center template is also very good! By the way, there are also corresponding locomotive collection rules! Regarding installation, upload the direct installation version, install it directly, and then restore the data in the background. There is a view more on the mobile phone. If there is a problem, you can copy the view more code in index.js on the PC. If it has not taken effect yet, please check whether the js file renderings are referenced...
👁 2695