Category: PHP

What is the difference between BLOB AND TEXT in MySQL?

A BLOB is a binary large object that can hold a variable amount of data. There are four types of BLOB

  • TINYBLOB
  • BLOB
  • MEDIUMBLOB and
  • LONGBLOB

They all differ only in the maximum length of the values they can hold.

A TEXT is a case-insensitive BLOB. The four TEXT types

  • TINYTEXT
  • TEXT
  • MEDIUMTEXT and
  • LONGTEXT

They all correspond to the four BLOB types and have the same maximum lengths and storage requirements.

The only difference between BLOB and TEXT types is that sorting and comparison is performed in case-sensitive for BLOB values and case-insensitive for TEXT values.

Difference between CHAR and VARCHAR?

Following are the differences between CHAR and VARCHAR:

  • CHAR and VARCHAR types differ in storage and retrieval
  • CHAR column length is fixed to the length that is declared while creating table. The length value ranges from 1 and 255
  • When CHAR values are stored then they are right padded using spaces to specific length. Trailing spaces are removed when CHAR values are retrieved.

How to disable comments in WordPress?

To disable comments in WordPress, Please follow below steps

Step 1: Login to your WordPress admin panel.
Step 2: Go to the Settings menu.
Step 3: Under Settings menu click on Discussion.
Step 4: Uncheck Allow people to post comments on new articles. checkbox
Step 5: Click on save changes button, you done

What is usermeta function in WordPress?

The usermeta function is used to retrieve the metadata of users. It can return a single value or an array of metadata.

Syntax is: get_user_meta( int $user_id, string $key = ”, bool $single = false )

User id is the required user id parameter

Key is the optional parameter which is the meta key to retrieve. By default, it returns data for all key values.

Single is an optional parameter that tells whether the single value will return. By default, it is false.