分页: 9/31 第一页 上页 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 下页 最后页 [ 显示模式: 摘要 | 列表 ]

在et上分页的php设计(php分页)

[不指定 2007/12/29 04:18 | by Else ]
  //处理分页

    $page=1;  //起始的记录
    $pagelist=2;    //每页显示的记录
    
    if (isset($_GET['page'])) {
        $page = $_GET['page'];
    }
    $sqlstr = "select * from cuku_products order by id desc ";    //所有的记录
    //算总的记录
    if (isset($_GET['total'])) {
      $total = $_GET['total'];
    } else {
      $all_rs = $db->query($sqlstr);
      $total= $db->num_rows($all_rs);    //总得记录
    }
Tags: , ,

学java吧

[不指定 2007/12/26 23:08 | by Else ]
点击在新窗口中浏览此图片
Tags:

C#连接Access成功

[不指定 2007/12/24 00:48 | by Else ]
C#链access 之前一直用链接sqlserver的函数做程序,一直出错,现在可以了
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.OleDb;

namespace test.src.util
{
    public class DbConnction
    {
        public DbConnction()
        {
            //
        }

        static void Main(string[] args)
        {

            String connectionString = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=";
            connectionString += @"d:\data.mdb";
            OleDbConnection myConnection = new OleDbConnection(connectionString);
            
            myConnection.Open();        //打开数据库链接
            OleDbCommand myCommand = myConnection.CreateCommand();    //定义SqlCommand变量
          

            myCommand.CommandText = "select * from ruby";           //设置SQL语句
            OleDbDataReader myDataReader = myCommand.ExecuteReader(); // 从数据库获职数据
            
            //读取DataReader中的数据并输出

            while (myDataReader.Read())
            {
                Console.WriteLine("\t{0}\t{1}", myDataReader["id"], myDataReader["title"]);
            }

            myDataReader.Close();               //关闭SqlDataReader
            myConnection.Close();               //关闭链接
            
            Console.WriteLine("这个是一个链接的测试");
        }

    }
}
Tags: ,

php地址栏的参数

[不指定 2007/12/22 18:53 | by Else ]

$insertGoTo = "admin.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
Tags:

C#數據類型判斷

[不指定 2007/12/19 15:35 | by Else ]

using System;
using System.Collections.Generic;
using System.Text;

public class Test2
{
  public void aaB(string a, int b)
        {
            if(a!=null)
      {
        Console.WriteLine("The stirng  is " + a + ",  the number is " + b);
      }
      else
      {
        Console.WriteLine("error");
      }
        }
  public void checkType(object type)
  {
        Console.WriteLine("The "+type+" type is {0},", type.GetType());
  }
  public static void Main()
  {
    Test2 ts = new Test2();
    string a="my name is a";
    int b=3662296;
    ts.aaB(a,b);
    int   i   =   5;  
    string k="哈,今天的天氣不錯,我叫string ";
    Console.WriteLine("i   is   an   int   ?   {0}" , i.GetType() == typeof(int));
    Console.WriteLine("i   is   an   int   ?   {0}" , typeof(int).IsInstanceOfType(i));
    Console.WriteLine("k   is   an   int   ?   {0}" , typeof(int).IsInstanceOfType(k));
    Console.WriteLine("The type of k is {0},",k.GetType());
    ts.checkType(k);
    ts.checkType(i);
    
    
    
  }
  
}
简单的就这么点,无限分类的,还要等待
        <select name="catid" id="catid">
          <!--$list as $rs-->
           <optgroup label="{rs['classname']}" title="{rs['content']}">
         <!-- <option value="{rs['id']}">{rs['classname']}</option>-->
          <!-- $rs['a'] AS $rs -->
          <option value="{rs['id']}">{rs['classname']}</option>
           <!-- end-->
         <!-- end-->
        </select>

把雙精度轉換成帶有逗號的數

[不指定 2007/12/13 16:20 | by Else ]

        /// <summary>
        /// 把雙精度轉換成帶有逗號的數
    /// sahu@qq.com
        /// </summary>
        /// <param name="kstr"></param>
        /// <returns></returns>
        public string getDublicToStr(double dbstr)
        {
          string a = dbstr.ToString();
          string[] b = a.Split('.');        
          string f = dbstr.ToString("#,##0")+"."+b[1];    //保證小數點後面相同
      return f;
        }
Tags:

DateTime.ToString()用法详解

[不指定 2007/12/11 17:58 | by Else ]

我们经常会遇到对时间进行转换,达到不同的显示效果,默认格式为:2006-6-6 14:33:34
如果要换成成200606,06-2006,2006-6-6或更多的格式该怎么办呢?
这里将要用到:DateTime.ToString的方法(String, IFormatProvider)
示例:
using System;
using System.Globalization;
String format="D";
DateTime date=DataTime.Now;
Response.Write(date.ToString(format, DateTimeFormatInfo.InvariantInfo));
结果输出
Thursday, June 16, 2006

奋斗灵珊(小仙儿)

[不指定 2007/12/11 14:19 | by Else ]
Tags: , ,

顯示的js

[不指定 2007/12/10 15:10 | by Else ]
js版
<script language="javascript" type="text/javascript">
function show(id){
  try{
    var n = id;
    for(i=1;i<6;i++)
  {
        document.getElementById('shop'+i).style.display='none';
     }
  
  
    document.getElementById('shop'+n).style.display='block';
    
  }catch(e){}
}
</script>

jq版

function showdNews(n,oobj)
{
show=oobj+n;  
for(i=1;i<5;i++){
$('#'+oobj+i).hide();  
}  
$('#'+show).show();
}
Tags: ,
分页: 9/31 第一页 上页 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 下页 最后页 [ 显示模式: 摘要 | 列表 ]