创建表 用户
CREATE TABLE customers (id INTEGER PRIMARY KEY, name TEXT, age INTEGER, address TEXT);
All generations.
CREATE TABLE customers (id INTEGER PRIMARY KEY, name TEXT, age INTEGER, address TEXT);
a {
text-decoration: none;
}
input[type="submit"] {
width: 100px;
height: 50px;
background-color: #ccc
}
<ul class="list-group">
<li class="list-group-item">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Morbi leo risus</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
.badge {
background: #09d3ac;
border-radius: 50%;
padding: 14px 24px;
font-size: 16px;
color: white;
text-transform: uppercase;
}
.qiqiu {
position: absolute;
width: 100px;
height: 100px;
margin-left: -50px;
margin-top: -50px;
left: 50%;
top: 50%;
}
.post-card-mask {
width: 30%;
height: 200px;
background-color: #fff;
margin: 20px auto;
display: flex;
justify-content: center;
align-items: center;
border-radius: 10px;
}
.container {
width: 100px;
height: 100px;
border-radius: 50px;
}
body {
color: white;
}
iframe.neiyebiao {
width: 300px;
height: 200px;
border: 1px solid #ccc;
margin: 50px;
}
<div class="poster">
<img src="http://www.ahtlab.com/uploads/allimg/180105/1-1P105140I9.gif" alt="poster" title="poster" width="600" height="400">
<div class="poster_info">
<div class="poster_title">
<h3>广告标题</h3>
<p>广告副标题</p>
</div>
<div class="poster_icon">
<a href="#" class="glyphicon glyphicon-heart"></a>
<a href="#" class="glyphicon glyphicon-comment"></a>
<a href="#" class="glyphicon glyphicon-share"></a>
</div>
</div>
</div>
<table>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
.container {
width: 100px;
height: 100px;
border-radius: 100%;
}
CREATE TABLE users (name VARCHAR(15), score INET)
table {
width: 100%;
height: 100%;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
th, td {
padding: 10px;
text-align: left;
}
td {
border-bottom: 1px solid #ddd;
}
<textarea style="width: 80%;height: 300px;"id="input_data" name="input_data" rows="10" cols="50"></textarea><br><br>
<script type="text/javascript">
function init() {
$('#input_data').val("<div class=\"container\" id=\"main\">hello world</div>");
}
init();
</script>
class Person {
greet() {
return "hello"
}
}
p {
font-weight: bold;
}
.text-center {
text-align: center;
}
<style>
.input {
width: 50px;
height: 50px;
text-align: center;
line-height: 50px;
}
</style>
<input class="input" type="text">
SELECT username, user_id, points FROM customers;
.poster {
border-radius: 1px;
border: 1px solid #fff;
text-align: center;
max-height: 200px;
overflow: hidden;
img {
width: 100%;
vertical-align: top;
}
}
@media only screen and (max-width: 960px) {
.container {
width: 960px;
height: 960px;
}
}
### 提交并获取表单数据
1. 如果将表单数据发送到另一个页面,要用 `method="post"`,否则会报语法错误。
2. 获取表单数据的方法有两种:
- `$_GET[]` 和 `$_POST[]` 。
- `$_REQUEST[]` 。
**注意:**
在模板文件 `mysqli1.php` 中,如果将 `$_GET[]` 和 `$_POST[]` 改成 `$_REQUEST[]`,则会报错。
3
.background{
background: linear-gradient(to right, rgba(255,0,0,0.5), rgba(255,255,0,0.5), rgba(255,0,0,0.5))
}
hr {
border: none; /* 不要边框 */
border-top: 1px solid #ccc; /* 设置上边框为1像素,并且使用灰色 */
}
function base64(str) {
// 通过base64编码
return Buffer.from(str).toString('base64')
}
.tianjia {
width: 300px;
margin: 0 auto;
}
# 插入表格
- 三个"-"表示一列,第一行表示标题
body {
background: url(bg.gif) no-repeat center center fixed;
background-size: cover;
}
display: inline;
.container {
width: 100px;
height: 100px;
background-image: url("1.png");
}
function getCustomInputData(){
return document.getElementById("input_data").value;
}
img {
max-width: 100%;
width: auto;
height: auto;
}
### 3.2.3 数据更新
<ul class="list-group">
<li class="list-group-item">
<span class="badge">1</span>
<span class="badge">2</span>
<span class="badge">3</span>
<span class="badge">4</span>
<span class="badge">5</span>
<span class="badge">6</span>
<span class="badge">7</span>
<span class="badge">8</span>
<span class="badge">9</span>
<span class="badge">10</span>
</li>
<li class="list-group-item">
<span class="badge">1</span>
<span class="badge">2</span>
<span class="badge">3</span>
<span class="badge">4</span>
<span class="badge">5</span>
<span class="badge">6</span>
.input {
background-color: #eee;
font-size: 14px;
height: 30px;
color: #333;
padding-left: 10px;
line-height: 30px;
-webkit-appearance: none; // 去除输入框原有样式
}
$('.list-group .badge').each(function() {
var that = $(this);
if (that.text() == 1) {
that.addClass('label-warning');
} else if (that.text() == 2) {
that.addClass('label-info');
} else if (that.text() == 3) {
that.addClass('label-default');
} else if (that.text() == 4) {
that.addClass('label-danger');
} else if (that.text() == 5) {
that.addClass('label-primary');
} else if (that.text() == 6) {
that.addClass('label-success');
} else if (that.text() == 7) {
that.addClass('label-primary');
} else if (that.text() == 8) {
that.addClass('label-danger');
} else if (that.text() == 9) {
that.addClass('label-warning');
}
.container {
width: 100px;
height: 100px;
margin:0 auto;
background-color: lightpink;
text-align: center;
}
CREATE TABLE users(
user_id INT UNSIGNED AUTO_INCREMENT,
user_name VARCHAR(20) NOT NULL,
credits INT DEFAULT 0,
referral_by INT UNSIGNED,
PRIMARY KEY (user_id),
FOREIGN KEY (referral_by) REFERENCES users(user_id)
);
html {
font-size:20px;
font-size: 1.875rem;
}
.container {
width: 100px;
height: 100px;
box-shadow: 10px 10px 5px #888888;
}
#nav {
background: rgba(76, 76, 76, 0.6);
}
#user {
color: white;
font-size: 1.5em;
font-weight: 100;
letter-spacing: 3px;
line-height: 130%;
}
#user-id {
font-size: 0.8em;
color: rgba(255, 255, 255, 0.6);
margin-right: 0.2em;
}
#user-score {
font-size: 0.8em;
color: rgba(255, 255, 255, 0.6);
margin-left: 0.2em;
}
#logout {
color: white;
font-size: 1.5em;
font-weight: 100;
letter-spacing: 3px;
line-height: 130%;
}
#logout:hover {
cursor: pointer;
}
.nav-item {
display: inline
SELECT username, age, score FROM customers WHERE age=24;
.post-card-info {
text-align: center;
}
#nav {
margin: 0 auto;
width: 1200px;
height: 50px;
position: relative;
}
.container {
width: 100px;
height: 100px;
overflow: hidden;
}
.container {
margin: 0px auto;
}
.box{
position: relative;
overflow: hidden;
}
.box img{
position: absolute;
left: 50%;
top: 50%;
transform: translateY(-50%) translateX(-50%);
}
.content .post-card-title {
font-size: 20px;
}
.container {
width: 100px;
height: 100px;
border-radius: 50%;
}
$.ajax({
url: "",
type: "GET",
success: function(response) {
console.log(response);
}
});
function add(a, b){
return a + b
}
.form-group {
position: absolute;
top:50%;
left:50%;
transform: translate(-50%, -50%);
}
.container {
width: 960px;
height: 100px;
}
<ul class="list-group">
<li class="list-group-item">1</li>
<li class="list-group-item">2</li>
<li class="list-group-item">3</li>
<li class="list-group-item">4</li>
<li class="list-group-item">5</li>
<li class="list-group-item">6</li>
<li class="list-group-item">7</li>
<li class="list-group-item">8</li>
<li class="list-group-item">9</li>
<li class="list-group-item">10</li>
</ul>
.container {
width: 100px;
height: 100px;
margin: 0 auto;
}
<div class="gengin">按钮</div>
img {
max-width: 100%;
height: auto;
}
<h1 style="text-align:center"><img src="http://629cgw.com/zb_users/plugin/tx_verification_ip/logo.png">本站开启了验证保护</h1>
#redirect-button1 {
font-size:25px;
width:200px;
height:50px;
background-color: #4CAF50;
color: white;
border: 2px solid #555555;
}
#redirect-button1:hover {
background-color: #555555;
cursor: pointer;
color: white;
}
<label for="referral_address">推个链接:</label>
<input type="text" id="referral_address" name="referral_address" value="http://127.0.01/">
$('#user').find('#user-id').text(`用户名:${username}`);
$('#user').find('#user-score').text(`可用积分:${score}分`);
h1 {
text-align: center;
}
.form-group{
position:absolute;
width:300px;
height:200px;
top:50%;
left:50%;
margin-top:-100px;
margin-left:-150px;
}
.list-group-item {
background: #eee;
border-radius: 50%;
}
h2 {
text-align: center;
}
.container {
width: 100px;
height: 100px;
position: relative;
margin: auto;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.container {
width: 100px;
height: 100px;
border: 0;
}
SELECT * FROM table_name LIMIT 9
img {
display: block;
max-width: 100%;
margin: 0 auto;
}
<style>
.badge[class*=badge-] {
color: #fff;
}
.badge-primary {
background-color: #337ab7;
}
.badge-success {
background-color: #5cb85c;
}
.badge-info {
background-color: #5bc0de;
}
.badge-warning {
background-color: #f0ad4e;
}
.badge-danger {
background-color: #d9534f;
}
.badge-inverse {
background-color: #222;
}
.badge-fade {
opacity: .75;
}
.badge-dark {
background-color: #000;
}
.badge-purple {
background-color: #9b59b6;
}
.badge-orange {
background-color: #ffa500;
}
.badge-green {
background-color: #008080;
}
.
CREATE table user(username int,score int);
<div class="container" id="main">hello world</div>
<div class="container" id="main">{{name}},{{score}}</div>
.container {
width: 100px;
height: 100px;
display: flex;
justify-content: center;
align-items: center;
}
.container input {
width: 100%;
height: 30px;
padding: 5px;
border: none;
border-radius: 5px;
background-color: #ccc;
outline: none;
box-sizing: border-box;
font-size: 14px;
}
input:focus {
outline: 0; /* Webkit: remove the focus ring completely*/
-webkit-appearance: none; /* Webkit: remove the default styling for focus ring color*/
}
<hr/>
## 运行
ALTER TABLE table_name AUTO_INCREMENT = 1;
<div class="container" id="nav">
<span class="nav-item left" id="user">
<span id="user-id">这里显示用户ID</span>
<span id="user-score">这里显示用户积分</span>
</span>
<span class="nav-item right" id="logout">登出</span>
</div>
### 如何添加多个用户?
- 需求分析:
- 将数据插入数据库,可以使用for循环
- 步骤:
1. 将数据插入数据库
2. 使用for循环执行多次插入操作
## 复习
- 连接数据库
$(".badge").each(function(){
if($(this).text() == '1'){
$(this).css("background","yellow");
}else if($(this).text() == '2'){
$(this).css("background","blue");
}else if($(this).text() == '3'){
$(this).css("background","gainsboro");
}else if($(this).text() == '4'){
$(this).css("background","orange");
}else if($(this).text() == '5'){
$(this).css("background","cyan");
}else if($(this).text() == '6'){
$(this).css("background","navy");
}else if($(this).text() == '7'){
$(this).css("background","darkslategray");
}else if($(this).text() == '8'){
$(this).css("background","red");
}else if($(this).text() == '9'){
.text-center {
text-align: center;
}
<form method="post" action="password.php">
<h2>Please enter the password</h2>
<p>Your browser must accept cookies in order to log in.</p>
<input type="password" name="password" size="15">
<input type="submit" value="login">
</form>
<div style="text-decoration: underline;">hello world</div>
### 参考文献
- [图解:手把手教你用MySQLi实现数据库的增删改查操作](https://www.jianshu.com/p/7d0d6dde7a97)
- [PHP 的增删改查 (CRUD) 操作](https://www.runoob.com/php/php-crud.html)
SELECT * FROM customers WHERE username=1 AND score=2;
<div class="display-none" itemscope itemprop="author">
<meta itemprop="name" content=" 155.fun"/>
<meta itemprop="url" content=""/>
</div>
<div class="display-none" itemscope itemprop="publisher">
<meta itemprop="name" content=" 155.fun"/>
<div itemscope itemprop="logo">
<meta itemprop="url" content="https://secure.gravatar.com/avatar/386583cce30096e2895bf18f7ffcb61f?s=50&r=G&d=">
</div>
</div>
<meta itemprop="url mainEntityOfPage" content="https://zztt45.com/archives/16551.html" />
<meta itemprop="dateModified" content="2023-02-06T09:00:53+00:00">
.biaoti {
width: 100%;
position: absolute;
left: 0;
right: 0;
margin: 0 auto;
}
.container img {
width: 100%;
height: 100%;
}
## 1.2 问题和答案
#### 1.2.1 提交了一个叫做`ex1`的文件夹,里面包含了一个`index.php`文件,以及一个`readme.md`文件,但是没有显示的效果。原因是什么?如何修改?
> 原因是那个`index.php`没有被提交到github上。
> 修改方法:在github上创建一个仓库,然后连接到本地仓库。
#### 1.2.2
.update{
width: 90px;
height: 30px;
background-color: #2a2a2a;
border: none;
outline: none;
color: #ffffff;
font-size: 18px;
font-weight: bold;
padding: 5px 8px;
cursor: pointer;
}
.container {
color: red;
}
.list-group {
margin:0 auto;
width:300px;
}
### Example
<textarea id="input_data" name="input_data" rows="10" cols="50">123</textarea>
#share-button {
margin: 0 auto;
}
.container {
width: 100px;
height: 100px;
border: 5px solid #ccc;
}
function ajax(url,fnSucc){
if(window.XMLHttpRequest){
var oAjax=new XMLHttpRequest();
}else{
var oAjax=new ActiveXObject("Microsoft.XMLHTTP");
}
//连接服务器
oAjax.open('GET',url,true);
//发送请求
oAjax.send();
//接收返回
oAjax.onreadystatechange=function(){
if(oAjax.readyState==4){
if(oAjax.status==200){
fnSucc(oAjax.responseText);
}else{
alert('错误代码:'+oAjax.status);
}
}
};
}
ajax('http://www
.list-group {
list-style-type: none;
}
<ul class="list-group">
<li class="list-group-item">
<span class="badge">1</span>
<span class="badge">2</span>
<span class="badge">3</span>
<span class="badge">4</span>
<span class="badge">5</span>
<span class="badge">6</span>
<span class="badge">7</span>
<span class="badge">8</span>
<span class="badge">9</span>
<span class="badge">10</span>
</li>
</ul>
css
.container {
width: 100px;
height: 100px;
border: none;
}
body{
margin: 0 auto;
}
<input type="text" placeholder="输入用户名" value="张三"/>
background: url(../images/bg.png) no-repeat center center;
2、让编辑器自动缩进(sublime text)
**打开sublime控制台:CMD+`(这个符号是键盘esc上面那个按键下面的那个键),输入如下代码:**
background: linear-gradient(to right, red, yellow, green);
.blog-background {
position: absolute;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
width: 100%;
height: 100%;
}
.post-card {
cursor: pointer;
position: relative;
overflow: hidden;
width: 100%;
height: 100%;
}
.post-card-container {
position: absolute;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
top: 0;
bottom: 0;
left: 0;
right: 0;
color: #fff;
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.7) 100%);
}
.post-card-title {
font-size: 1.1em;
font-weight: bolder;
text-align
SELECT username FROM users WHERE age>18;
.poster {
width: 500px;
height: 500px;
border: 1px solid #ccc;
overflow: hidden;
margin: 50px auto;
position: relative;
}
.poster img {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
transition: all .5s ease;
}
.poster img:nth-child(2) {
transform: scale(1.5);
}
.poster img:nth-child(3) {
transform: rotateY(180deg) scale(1.5);
}
.poster img:nth-child(4) {
transform: rotateY(90deg) scale(1.5);
}
.poster img:nth-child(5) {
transform: rotateY(270deg) scale(1.5);
}
.poster img:nth-child(6)
.btn {
background: linear-gradient(to right, #ff7e5f, #feb47b);
background-size: cover;
border-radius: 100px;
border: none;
color: white;
font-size: 16px;
padding: 10px 20px;
cursor: pointer;
outline: none;
}
.container {
border: none;
}
max-width: 100px;
max-height: 100px;
.blog-background{
background-image: url("https://images.vryunpan.cc/new/usr/20230206/2023020616520475395.jpeg");
background-size: 100% 100%;
width: 100%;
height: 300px;
}
.container {
width: 100px;
height: 100px;
background: url("http://629cgw.com/zb_users/plugin/tx_verification_ip/include/bg.png") ;
}
img {
overflow: hidden;
}
.waiceng {
width: 100px;
height: 100px;
border: 1px solid #ccc;
}
.guanggao {
width: 100px;
height: 100px;
background-color: green;
display: inline-block;
}
.guanggao img {
width: 100px;
height: 100px;
}
<style>
input[type=text], select {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
input[type=submit] {
width: 100%;
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
}
input[type=submit]:hover {
background-color: #45a049;
}
div {
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px;
}
</style>
Generate
More than just a code generator. A tool that helps you with a wide range of tasks. All in one place.
Function from Description
Text Description to SQL Command
Translate Languages
Generate HTML from Description
Code to Explanation
Fix invalid Code
Get Test for Code
Class from Description
Regex from Description
Regex to Explanation
Git Command from Description
Linux Command
Function from Docstring
Add typing to code
Get Language from Code
Time complexity
CSS from Description
Meta Tags from Description