mysql資料庫連結語法
<?php
$dbhost="localhost";
$dbuser="root";
$dbpass="";
$dberror1="Could Not Connect to Your Database";
$dberror2="Could Not Find Your Table";
mysql_pconnect($dbhost,$dbuser,$dbpass) or die ($dberror1);
$select_db=mysql_select_db('資料庫名稱') or die($dberror2);
mysql_query("SET NAMES UTF8");
if(isset($_POST['uCheck']) and isset($_POST['pCheck'])) {
if(isset($_POST['remember'])) {
//設定一名稱為rmUsername的cookie,記錄輸入的使用者帳號,保存期限30天
setcookie("rmUsername",$_POST['uCheck'],time()+3600*24*30);
//設定一名稱為rmPassword的cookie,記錄輸入的使用者密碼,保存期限30天
setcookie("rmPassword",$_POST['pCheck'],time()+3600*24*30);
}else{
setcookie("rmUsername",'', time()); //刪除記錄帳號的Cookie
setcookie("rmPassword",'', time()); //刪除記錄密碼的Cookie
}
}
?>
mysqli資料庫連結語法
<?php
$dbhost="localhost";
$dbuser="root";
$dbpass="";
$dberror1="Could Not Connect to Your Database";
$dberror2="Could Not Find Your Table";
$Conn=mysqli_connect($dbhost,$dbuser,$dbpass) or die ($dberror1);
$select_db=mysqli_select_db($Conn,'資料庫名稱') or die($dberror2);
mysqli_query($Conn,'set names utf8');
if(isset($_POST['uCheck']) and isset($_POST['pCheck'])) {
if(isset($_POST['remember'])) {
//設定一名稱為rmUsername的cookie,記錄輸入的使用者帳號,保存期限30天
setcookie("rmUsername",$_POST['uCheck'],time()+3600*24*30);
//設定一名稱為rmPassword的cookie,記錄輸入的使用者密碼,保存期限30天
setcookie("rmPassword",$_POST['pCheck'],time()+3600*24*30);
}else{
setcookie("rmUsername",'', time()); //刪除記錄帳號的Cookie
setcookie("rmPassword",'', time()); //刪除記錄密碼的Cookie
}
}
?>
mysql資料表查詢及內文列印語法
<?php
$row_web_shop=mysql_query("Select * FROM shop2pic");//資料表查詢
$web_shop= mysql_num_rows($row_web_shop);//函数返回结果集中行的数目
?>
<?php do { ?>
<?php if ($web_shop ['shop2pic_pic'] !== NULL){ ?>
<div style="margin-left:10px;width:650px;">
<li style="list-style-type:none;word-break:break-all;font-size:14px;margin-top:0px; border-bottom:#B3D983 0px solid ;margin-right:20px;float:left;height:150px;" >
<img style="border:0px blue solid;width:120px;" src="images/shop/<?php echo $web_shop['shop2pic_pic']; ?>" title="<?php echo $web_shop['p_color']; ?>"/>
<p style="border:0px red solid;margin-top:10px;height:20px;width:100px;overflow:hidden;text-align:center"> <b><?php echo mb_substr(strip_tags( $web_shop['p_color']),0,20,"UTF-8");?></b> <!--echo列印陣列行數的數目-->
</p>
</li>
</div>
<?php } // Show if recordset not empty ?>
<?php } while ($web_shop = mysql_fetch_assoc($row_web_shop)); ?>
mysqli資料表查詢及內文列印語法
<?php
$row_web_shop=mysqli_query($conn_web,"Select * FROM shop2pic");//資料表查詢
$web_shop= mysqli_num_rows($row_web_shop);//函数返回结果集中行的数目
?>
<?php do { ?>
<?php if ($web_shop ['shop2pic_pic'] !== NULL){ ?>
<li style="list-style-type:none;word-break:break-all;font-size:14px;margin-top:0px; border-bottom:#B3D983 0px solid ;margin-left:10px;float:left;" >
<img style="border:0px blue solid;height:100px;width:100px;" src="images/shop/<?php echo $web_shop['shop2pic_pic']; ?>" title="<?php echo $web_shop['p_color']; ?>"/>
<p style="border:0px red solid;margin-top:10px;height:20px;width:100px;overflow:hidden;text-align:center"> <b><?php echo mb_substr(strip_tags( $web_shop['p_color']),0,20,"UTF-8");?></b> <!--echo列印陣列行數的數目-->
</p>
</li>
<?php } // Show if recordset not empty ?>
<?php } while ($web_shop = mysqli_fetch_assoc($row_web_shop)); ?>
~歡迎轉載,但請註明來源網站名稱和網址,文章若有侵權,請來信告知,我們會盡快處理~
<?php
$dbhost="localhost";
$dbuser="root";
$dbpass="";
$dberror1="Could Not Connect to Your Database";
$dberror2="Could Not Find Your Table";
mysql_pconnect($dbhost,$dbuser,$dbpass) or die ($dberror1);
$select_db=mysql_select_db('資料庫名稱') or die($dberror2);
mysql_query("SET NAMES UTF8");
if(isset($_POST['uCheck']) and isset($_POST['pCheck'])) {
if(isset($_POST['remember'])) {
//設定一名稱為rmUsername的cookie,記錄輸入的使用者帳號,保存期限30天
setcookie("rmUsername",$_POST['uCheck'],time()+3600*24*30);
//設定一名稱為rmPassword的cookie,記錄輸入的使用者密碼,保存期限30天
setcookie("rmPassword",$_POST['pCheck'],time()+3600*24*30);
}else{
setcookie("rmUsername",'', time()); //刪除記錄帳號的Cookie
setcookie("rmPassword",'', time()); //刪除記錄密碼的Cookie
}
}
?>
mysqli資料庫連結語法
<?php
$dbhost="localhost";
$dbuser="root";
$dbpass="";
$dberror1="Could Not Connect to Your Database";
$dberror2="Could Not Find Your Table";
$Conn=mysqli_connect($dbhost,$dbuser,$dbpass) or die ($dberror1);
$select_db=mysqli_select_db($Conn,'資料庫名稱') or die($dberror2);
mysqli_query($Conn,'set names utf8');
if(isset($_POST['uCheck']) and isset($_POST['pCheck'])) {
if(isset($_POST['remember'])) {
//設定一名稱為rmUsername的cookie,記錄輸入的使用者帳號,保存期限30天
setcookie("rmUsername",$_POST['uCheck'],time()+3600*24*30);
//設定一名稱為rmPassword的cookie,記錄輸入的使用者密碼,保存期限30天
setcookie("rmPassword",$_POST['pCheck'],time()+3600*24*30);
}else{
setcookie("rmUsername",'', time()); //刪除記錄帳號的Cookie
setcookie("rmPassword",'', time()); //刪除記錄密碼的Cookie
}
}
?>
mysql資料表查詢及內文列印語法
<?php
$row_web_shop=mysql_query("Select * FROM shop2pic");//資料表查詢
$web_shop= mysql_num_rows($row_web_shop);//函数返回结果集中行的数目
?>
<?php do { ?>
<?php if ($web_shop ['shop2pic_pic'] !== NULL){ ?>
<div style="margin-left:10px;width:650px;">
<li style="list-style-type:none;word-break:break-all;font-size:14px;margin-top:0px; border-bottom:#B3D983 0px solid ;margin-right:20px;float:left;height:150px;" >
<img style="border:0px blue solid;width:120px;" src="images/shop/<?php echo $web_shop['shop2pic_pic']; ?>" title="<?php echo $web_shop['p_color']; ?>"/>
<p style="border:0px red solid;margin-top:10px;height:20px;width:100px;overflow:hidden;text-align:center"> <b><?php echo mb_substr(strip_tags( $web_shop['p_color']),0,20,"UTF-8");?></b> <!--echo列印陣列行數的數目-->
</p>
</li>
</div>
<?php } // Show if recordset not empty ?>
<?php } while ($web_shop = mysql_fetch_assoc($row_web_shop)); ?>
mysqli資料表查詢及內文列印語法
<?php
$row_web_shop=mysqli_query($conn_web,"Select * FROM shop2pic");//資料表查詢
$web_shop= mysqli_num_rows($row_web_shop);//函数返回结果集中行的数目
?>
<?php do { ?>
<?php if ($web_shop ['shop2pic_pic'] !== NULL){ ?>
<li style="list-style-type:none;word-break:break-all;font-size:14px;margin-top:0px; border-bottom:#B3D983 0px solid ;margin-left:10px;float:left;" >
<img style="border:0px blue solid;height:100px;width:100px;" src="images/shop/<?php echo $web_shop['shop2pic_pic']; ?>" title="<?php echo $web_shop['p_color']; ?>"/>
<p style="border:0px red solid;margin-top:10px;height:20px;width:100px;overflow:hidden;text-align:center"> <b><?php echo mb_substr(strip_tags( $web_shop['p_color']),0,20,"UTF-8");?></b> <!--echo列印陣列行數的數目-->
</p>
</li>
<?php } // Show if recordset not empty ?>
<?php } while ($web_shop = mysqli_fetch_assoc($row_web_shop)); ?>
響應式網頁架站只要6,888元起|[RWD]響應式網站,自適應網頁,讓SEO搜尋引擎最佳化你的網站
"你是獵人還是獵物?"
0 comments :
張貼留言
1.猛甲茶道,歡迎多留言,可以幫自己網站打廣告~
2.需要 猛甲茶道 回覆,請勿使用匿名留言[可使用名稱/網址,名稱填自己名字,若無網址,請填E-mail]。
3.匿名攻訐、不相干之廣告適用於無條件刪去法,望請海涵:)
4.您可以使用一些 HTML 標記,如:
<b>粗體</b>, <i>斜體</i>, <a href='網址'>描述文字</a>