当前位置:网站首页>PHP syntax
PHP syntax
2022-06-13 04:32:00 【Culvert.】
1 php Grammar format
<?php ?>2 Basic grammar
(1) Output :echo
(2) Defining variables :$ Variable name = value
(3) String splicing .
(4)var_dump( Variable ): Output the data types in the array
(5)print_r( Array ): The output mode of the array
(6)foreach Traversal array :foreach( Array name as Content )
(7) Traversal array output subscript :foreach( Array name as $key=> $value)
(8)get request :$_GET
(9)form attribute :action For the current form Location of data submission
(10)input attribute : Then get the value entered by the user
3 PHP Connect to database
(1) Create database
$con=mysqli_connect(‘localhost’,‘root’,‘lileidb’)
(2) Set encoding
mysqli_query($con,‘set names utf8’)
(3) To write sql sentence
$sql=“insert into userinfo( Field 1, Field 2,…) values( field value , field value )”
(4) perform sql sentence
mysqli_query($con, $sql)
(5) Close the database
mysqli_close($con)
4 SQL sentence
(1) Insert
$sql=“insert into userinfo( Field 1, Field 2,…) values( field value , field value )”
(2) Delete
$sql=“delete from Table name where id= $id”
(3) modify
$sql=“update Table name set Field 1=‘ The new value 1’,…where id= $id”
(4) Inquire about
$sql=“select Information from Table name where Conditions ”
边栏推荐
猜你喜欢

Li Kou brush question 647 Palindrome substring

120. triangle minimum path sum - Dynamic Planning

Express scaffold creation

Catalan number

Data analysis report

Redis主从复制、哨兵模式、集群

Li Kou brush question 338 Bit count

dumi 搭建文檔型博客

2022 ICLR | CONTRASTIVE LEARNING OF IMAGE- AND STRUCTURE BASED REPRESENTATIONS IN DRUG DISCOVERY

Day45. data analysis practice (1): supermarket operation data analysis
随机推荐
Configuration and practice of shardingsphere JDBC sub database separation of read and write
Hugo blog building tutorial
This Sedata uses multiple methods to dynamically modify objects and values in arrays. Object calculation properties
C盘无损移动文件
[notes] summarize common horizontal and vertical centering methods
Application of dagger2 learning module (II)
[sword finger offer] interview question 24 Reverse linked list
Suffix Automaton
[sword finger offer] interview question 25 Merge two ordered linked lists
Analyse du principe de mise en œuvre d'un éditeur de texte open source markdown - to - rich
Redis persistence mode AOF and RDB
Summary of webdriver API for web automated testing
7-289 tag count (300 points)
Day45. data analysis practice (1): supermarket operation data analysis
Clear timer failure
XOR prefix and +map maintenance
一致性哈希的简单认识
【自动化测试】关于unittest你需要知道的事
Redis主从复制、哨兵模式、集群
PHP security development 15 user password modification module