//------------建立名叫temp_test的temptable 然後給值 來源是table1
$set_table='CREATE TEMPORARY TABLE `temp_test` ENGINE = MYISAM
SELECT a, b, c, d, e FROM `table1`';
//------------------------------------------------------------
mysql_query($set_table) or die(mysql_error().$set_table);
//--------------------------------寫入另一個表格資料
$set_table2='insert into `temp_test` SELECTa, b, c, d, e FROM `table2`';
mysql_query($set_table2) or die(mysql_error().$set_table2);
Posted by 歐迪 at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()
這通常是不經意的小錯誤
ex:你有載入其它js檔裡面有用到$()等相關語法,但你在主頁的時候
<script type="text/javascript" src="../js/xxx.js"></script><=這裡就會跳出error msg 因為裡面有用到$
<script type="text/javascript" src="http://www.google.com/jsapi"></script><=這兩段應該放在最上面
<script type="text/javascript">google.load("jquery","1");</script>
Posted by 歐迪 at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()
<input onkeydown= "if(event.keyCode==8) return false ">
Posted by 歐迪 at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()
<?php
if(isset($_GET['f'])){
$str=urldecode($_GET['f']);//解碼
$filename=substr($str,strrpos($str,'/')+1,strlen($str)-strrpos($str,'/'));//取出檔案名稱
$file="../xxx/".$filename;//檔案相對路徑
//指定類型
Posted by 歐迪 at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()
<?php
echo str_replace("world","John","Hello world!");
?>
Hello John!
str_replace(參數1,參數2,參數3)
參數1<=要找的字
參數2<=找到後取代成這個
參數3<=來源字串
Posted by 歐迪 at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()
[Cannot redeclare function_name()]此錯誤訊息表示你的函式重覆宣告
請先檢查是不是有重覆require某程式(放該 function),如果是可將改成 require =>require_once,這樣就不會載入兩次。
若非上述狀況,請檢查該function是否存在於某個 for迴圈、while、foreach裡,請將此function搬出即可。
Posted by 歐迪 at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()
$currentFile = $_SERVER["PHP_SELF"]; 取得目前執行的檔案名稱(會有路徑)
$parts = Explode('/', $currentFile); 依 '/'分成多個陣列元素
$exe_name=$parts[count($parts) - 1];取得最後一個陣列元素 就會是我們要的 test.php
Posted by 歐迪 at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()