Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The problem of reference variables in PHP strings

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

String reference variables in php are mainly different database operation strings.

1, normal string reference variable

a. The outer layer must quote double quotation marks

b. Variables in a string can be written as: $s or {$s}

two。 Database operation string (database operation instruction)

a. Double quotes must be used in the outer layer of a string

b. Variables must use curly braces {} (except when assigning string attributes), such as:

`c. When a variable is required to be assigned to a database property or to perform a logical operation, the type of the corresponding data attribute is required, such as

The attribute title,authordid,content in the database in the above code is a string, so the variable should be in single quotation marks'{$title}'or'$title',.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report