当前位置:网站首页>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 ”
边栏推荐
- Reread the classic: end to end object detection with transformers
- Alipay native components (hotel time selection)
- Collection of wrong questions in soft test -- morning questions in the first half of 2010
- [kubernetes series] pod chapter actual operation
- VGA display based on de2-115 platform
- 基于DE2-115平台的VGA显示
- 工业互联网通用通信协议
- Applet waterfall flow
- Forgotten fleeting years
- PAT 1054 The Dominant Color
猜你喜欢
Google Chrome browser reports an error: net:: err_ BLOCKED_ BY_ CLIENT
Ctfshow SQL injection (231-253)
Dumi construit un blog documentaire
一款開源的Markdown轉富文本編輯器的實現原理剖析
Express framework knowledge - Art template template, cookie, session
120. 三角形最小路径和-动态规划
基于DE2-115平台的VGA显示
Redis
Sword finger offer 56 - I. number of occurrences in the array
1-72 convert string to decimal integer
随机推荐
MVP framework for personal summary
CTFSHOW SQL注入篇(211-230)
Applet waterfall flow
Li Kou brush question 647 Palindrome substring
Returns the width and height of an element
Sword finger offer 11 Minimum number of rotation array - binary lookup
Collection of wrong questions in soft test -- morning questions in the first half of 2011
Dumi construit un blog documentaire
php开发博客系统的首页头部功能实现
Simple static web page + animation (small case)
Forgotten fleeting years
Alipay native components (hotel time selection)
Express framework knowledge - Art template template, cookie, session
Day45. data analysis practice (1): supermarket operation data analysis
Dumi builds a document blog
在线音频调节技术汇总
Application of dagger2 learning module (II)
Redis
Applet version update
剑指 Offer 11. 旋转数组的最小数字-二分查找