Time of Update: 2016-06-05
標籤:查詢頁面(使用者可見)<body><table width="80%" border="1" cellpadding="0" cellspacing="0"><tr><td>民族代號</td> <td>民族名稱</td> <td>操作</td></tr><?php//造一個串連$conn =
Time of Update: 2016-06-04
標籤:顯示頁面:<body><table width="100%" border="1" cellpadding="0" cellspacing="0"> //建立一個民族表表格<tr><td>民族代號</td> //建列 <td>民族名稱</td> //建列 <td>操作</td> &
Time of Update: 2016-06-04
標籤:串連資料庫(傳統的方法)mysql_connect("lcoalhost","root",""); //串連本機資料庫,串連外機localhost可以改成制定ip地址mysql_select_db("txst",$db); //選擇要操作的資料庫$sql="select * from info"; //書寫MySQL語句$result=mysql_query($sql); //執行MySQL語句var_dump(
Time of Update: 2016-06-06
標籤:設定檔 程式 資料庫 網路 網上 在網上我們下載的程式,有很多並沒有安裝程式,而是需要我們手動修改資料庫設定檔 有的還需要網站路徑如網域名稱等,下面由魅力網路為大家解釋<?php$pe[‘db_host‘] = ‘localhost‘;伺服器名$pe[‘db_name‘] = ‘cps1‘;
Time of Update: 2016-05-27
標籤: /*讀取csv檔案*/ public function testCsv(){ $fileName = "tel.csv"; $fp=fopen($fileName,"r"); $data = fgetcsv($fp); $count = 1; $result = array(); while(!feof($fp) && $data = fgetcsv($fp))
Time of Update: 2016-05-25
標籤: 客戶的伺服器是windows2008R2 x64位的,資料庫是SQLServer2008版本,要在原來的.net的web版本系統基礎上做手機版本,又因為手機版本要支援支付,必須用有網域名稱的80連接埠,本人是用ThinkPHP3.2.3來做後台開發的,一系列下來發現,真是麻煩。在IIS7.0 (客戶已經安裝好II7.0 這裡就不多說安裝過程了,記得選擇:"CGI"、"ISAPI 擴充"、"ISAPI 篩選器")上支援php解析:最好方式是安裝
Time of Update: 2016-05-17
標籤:* 以單引號為定界符的php字串,支援兩個轉義\‘和\\* 以雙引號為定界符的php字串,支援下列轉義(\‘會直接輸出\‘ ,也會轉義 \\): \n 換行(LF 或 ASCII 字元 0x0A(10)) \r 斷行符號(CR 或 ASCII 字元 0x0D(13)) \t 水平定位字元(HT 或 ASCII 字元
Time of Update: 2016-05-15
標籤:準備篇:一、配置防火牆,開啟80連接埠、3306連接埠CentOS 7 預設使用的是firewall作為防火牆,這裡改為iptables防火牆。1、關閉firewall:systemctl stop firewalld.service #停止firewallsystemctl disable firewalld.service #禁止firewall開機啟動2、安裝iptables防火牆yum install iptables-services #安裝vi
Time of Update: 2016-05-09
標籤:autocommit(0) 關閉事務自動認可commit() 提交rollback() 復原 <?phpheader(‘content-type:text/html;charset=utf-8‘);$mysqli = @new mysqli(‘localhost:3306‘, ‘root‘, ‘root‘, ‘zhy‘);if ($mysqli->connect_errno) { die(‘mysqli connect error : ‘ . $mysqli-&
Time of Update: 2016-05-09
標籤:<?phpheader("Content-type:text/html;charset=utf-8");//串連資料庫$con = mysql_connect("localhost","root","");if ($con) {//選擇資料庫mysql_select_db("test",$con);//獲得GET裡面的值$idid = $_GET["id"];//查詢資料庫$query = mysql_query("SELECT id,username FROM user
Time of Update: 2016-05-11
標籤:【PDO是啥】PDO是PHP 5新加入的一個重大功能,因為在PHP 5以前的php4/php3都是一堆的資料庫擴充來跟各個資料庫的串連和處理,什麼 php_mysql.dll、php_pgsql.dll、php_mssql.dll、php_sqlite.dll等等擴充來串連MySQL、PostgreSQL、MS SQL
Time of Update: 2016-05-07
標籤:核心方法$mysqli_stmt = mysqli->prepare($sql); // 預先處理,返回statement對象$mysqli_stmt->bind_param(); // 綁定參數, 類型對應關係如下: i : Integer s : String d : double b : blob$mysqli_stmt->excute(); // 執行sql <?php$mysqli = @new
Time of Update: 2016-05-06
標籤:摘要:我們php手手工安裝的,php的預設設定檔在 /usr/local/apache2/conf/php.ini,我們最主要就是要配置php.ini中的內容,讓我們執行 php能夠更安全。整個PHP中的安全設定主要是為了防止phpshell和SQL Injection的攻擊...轉載請註明來源:在php中防止SQL注入的方法【一、在伺服器端配置】
Time of Update: 2016-05-04
標籤:查詢所有:fetch_all() MYSQLI_NUM MYSQLI_ASSOC MYSQLI_BOTH查詢一條:fetch_row()fetch_assoc()fetch_object()fetch_array() MYSQLI_NUM MYSQLI_ASSOC MYSQLI_BOTH 用代碼說話:<?phpheader(‘content-type:text/html;charset=utf-8‘);$mysqli = new
Time of Update: 2016-05-04
標籤: 例子:$db = new MySQLi("localhost","root","","mydb");!mysqli_connect_error() or die ("串連失敗!");$sql="select * from Info,Nation where Info.Nation=Nation.Code";$result = $db->query($sql);if($result){ $attr = $result->fetch_all();
Time of Update: 2016-06-01
標籤:openresty lua php1. nginx.conf中配置訪問url訪問 api1.yingtrader.com/boquote,就會執行boquote.php代碼。650) this.width=650;" src="http://s4.51cto.com/wyfs02/M00/82/3A/wKiom1dOs3XisFbWAAD-ptQhK4g266.png" title="圖片10.png" alt="wKiom1dOs3XisFbWAAD-ptQhK4g266.png" />
Time of Update: 2016-05-13
標籤:php php7 PHP 7出來好一段時間了,前些日子工作比較忙,沒時間研究,現在有點時間了,公司裡生產環境不能隨便升級,家裡自己的電腦還是可以裝一下看看效果的。下面簡單說明一下PHP 7 + Apache 2.4的安裝。Apache 2.4 安裝配置安裝Apache
Time of Update: 2016-05-09
標籤:1,php_sapi_name()php_sapi_name返回web伺服器和php之間的介面類型。函數說明:string php_sapi_name(void)返回描述php所使用的介面類型的小寫字串,例如CLI的php下這個字串是“cli“,Apache下可能會有幾個不同的值,取決於使用的SAPI。執行個體:<?php$sapi_type = php_sapi_name();if (substr($sapi_type, 0, 3) == ‘cgi‘) {
Time of Update: 2016-05-09
標籤:php wampserver 開發環境 最近在學習php,本機上安裝測試環境,我的本機是win10 64位,為了方便,推薦使用WampServer ,它整合了apache、mysql、php,一次性全部搞定。WampServer 2.5 64位 整合了:Apache : 2.4.9MySQL : 5.6.17PHP &
Time of Update: 2016-05-09
標籤:1.確定win7 系統是否是win7 sp1 版本。因為Visual C++ Redistributable for Visual Studio 2015 需要win7的sp1包的支援才能安裝成功! 2.下載並且安裝Visual C++ Redistributable for Visual Studio 2015安裝包,地址:https://www.microsoft.com/zh-cn/download/details.aspx?id=48145。如果是x64系統,必須安裝x86與x64