2011 本站教學範例已全面更新~ 新教學請看 http://www.flycan.com/article/   【到新的教學討論區】
【飛肯設計學苑】- 回首頁 -
回首頁最新開課訊息企業包班教育訓練範例教學區問題討論區交流分享區程式下載區
Photoshop影像達人專修班 Photoshop 遮色片 & 色版創作進階班 CSS 版面設計專修班 ActionScript 3.0 程式設計入門班 ActionScript & XML 進階整合應用班 Dreamweaver & CSS網頁版型設計班

 

本站已全面更新~ 2011年 新教學範例請看 → http://www.flycan.com/article/

 

【DW PHP 資料庫】問題討論區
在DW CS3用2個"資料集(查詢)'會無法顯示頁面

發表新主題   回覆主題
【飛肯】教學網站 首頁 » 【DW PHP 資料庫】問題討論區
上一篇主題 :: 下一篇主題  
發表人 內容
a87sd
【新生】
【新生】


註冊時間: 2007-07-30
文章: 1

發表在DW CS3用2個"資料集(查詢)'會無法顯示頁面 引言回覆

發表於: 2008-02-05 22:27 
用上2個資料集後

網頁就顯示這些東西

★:
Warning: mysql_select_db(): supplied resource is not a valid MySQL-Link resource in d:\program files\easyphp1-8\www\index.php on line 53

Warning: mysql_query(): supplied resource is not a valid MySQL-Link resource in d:\program files\easyphp1-8\www\index.php on line 55

我把資料集範圍內的與法貼給大家看看

★:

<?php

if (!function_exists("GetSQLValueString")) {

function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

{

  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {

    case "text":

      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

      break;   

    case "long":

    case "int":

      $theValue = ($theValue != "") ? intval($theValue) : "NULL";

      break;

    case "double":

      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";

      break;

    case "date":

      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

      break;

    case "defined":

      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;

      break;

  }

  return $theValue;

}

}

$maxRows_News = 5;

$pageNum_News = 0;

if (isset($_GET['pageNum_News'])) {

  $pageNum_News = $_GET['pageNum_News'];

}

$startRow_News = $pageNum_News * $maxRows_News;

mysql_select_db($database_News, $News);

$query_News = "SELECT * FROM articletitle";

$query_limit_News = sprintf("%s LIMIT %d, %d", $query_News, $startRow_News, $maxRows_News);

$News = mysql_query($query_limit_News, $News) or die(mysql_error());

$row_News = mysql_fetch_assoc($News);

if (isset($_GET['totalRows_News'])) {

  $totalRows_News = $_GET['totalRows_News'];

} else {

  $all_News = mysql_query($query_News);

  $totalRows_News = mysql_num_rows($all_News);

}

$totalPages_News = ceil($totalRows_News/$maxRows_News)-1;

mysql_select_db($database_News, $News);                                                 //有問題的53行

$query_catalog = "SELECT * FROM `catalog`";

$catalog = mysql_query($query_catalog, $News) or die(mysql_error());   //有問題的55行

$row_catalog = mysql_fetch_assoc($catalog);

$totalRows_catalog = mysql_num_rows($catalog);

//***** PHP中限制文字顯示自訂函式開始 *****

function cutword($cutstring,$cutno){

 if(strlen($cutstring) > $cutno) {

  for($i=0;$i<$cutno;$i++) {

   $ch=substr($cutstring,$i,1);

   if(ord($ch)>127) $i++;

  }

 $cutstring= substr($cutstring,0,$i)."...";

 }

return $cutstring;

}

//***** PHP中限制文字顯示自訂函式結束 *****

?>

回頂端
檢視會員個人資料 發送私人訊息
從之前的文章開始顯示:   
發表新主題   回覆主題     1頁(共1頁)
【飛肯】教學網站 首頁 » 【DW PHP 資料庫】問題討論區

 
所有的時間均為 台北時間 (GMT + 8 小時)
前往:  

回首頁】【最新開課訊息】【企業委訓】【範例教學分享區】【問題討論區