نمایش نتایج: از شماره 1 تا 2 , از مجموع 2

موضوع: مشکل در وارد کردن اطلاعات

  1. #1
    عضو انجمن hannah آواتار ها
    تاریخ عضویت
    Jun 2010
    محل سکونت
    غرب مازندران
    نوشته ها
    738
    تشکر تشکر کرده 
    160
    تشکر تشکر شده 
    478
    تشکر شده در
    378 پست

    پیش فرض مشکل در وارد کردن اطلاعات

    سلام من میخوام اطلاعات دیتا بیس بذارم نمیدونم جای کدوم بذارم کمک کنید
    <?php
    /*
    ** Monster Top List 1.4
    ** Supplied By: lord
    ** Nullification By: Zygote
    ** */

    class DB
    { var $query_count = 0;
    var $db_count = 0;

    function connect($host,$user,$pass,$db,$pfx,$con_name,$def= 0)
    {
    if(!$con = mysql_connect($host,$user,$pass))
    { $this->error(0, 'Attempting to connect to mySQL',$con_name); }

    if(!mysql_select_db($db, $con))
    { $this->error(0, 'Attempting to Select Database',$con_name); }

    if($def == 1)
    { $this->defaultcon = $con; }

    $this->pfx[$con] = $pfx;

    $this->$con = $con;

    return $con;
    }

    function query($query, $con='', $no_error=0)
    {
    if($con == '')
    { $con = $this->defaultcon;
    }

    $pfx = $this->pfx[$con];

    if($pfx != "mtl_")
    { $query = preg_replace("/mtl_(\S+?)([\s\.,]|$)/", $pfx."\\1\\2", $query);
    }

    $this->query_count++;
    $t = (float) array_sum(explode(' ', microtime()));
    $this->query_id = mysql_query($query, $con);
    $t = $t - (float) array_sum(explode(' ', microtime()));
    $this->query_data[] = $query . ' [ Time: ' . $t . ' sec]';

    //echo "<p><pre>" . htmlentities($query) . "</pre></p>";

    if(!$this->query_id AND $no_error == 0)
    { $this->error(1, $query); }
    return $this->query_id;
    }

    function fetch_row($rid='a')
    { if($rid == "" OR $rid == 'a')
    { $rid = $this->query_id; }

    return mysql_fetch_array($rid);
    }

    function row_query($query, $con = '', $no_error = 0)
    {
    $oldqid = $this->query_id;
    $this->query($query, $con, $no_error);
    $row = $this->fetch_row();
    $this->query_id = $oldqid;
    return $row;
    }

    function col_query($query, $col = 0, $con='', $no_error = 0)
    {
    $oldqid = $this->query_id;
    $this->query($query, $con, $no_error);
    $col = $this->fetch_col($col);
    $this->query_id = $oldqid;
    return $col;
    }

    function fetch_col($col = 0, $rid='a')
    {
    $a = array();
    while($r = $this->fetch_row($rid))
    {
    $a[] = $r[$col];
    }
    return $a;
    }

    function fetch_one($col = 0, $rid='a')
    {
    if($this->count())
    {
    $r = $this->fetch_row($rid);
    return $r[$col];
    }

    return NULL;
    }

    function one_query($query, $col = 0, $con='', $no_error = 0)
    {
    $oldqid = $this->query_id;
    $this->query($query, $con, $no_error);
    $fld = $this->fetch_one($col);
    $this->query_id = $oldqid;
    return $fld;
    }

    function count($rid="")
    { if($rid == "")
    { $rid = $this->query_id; }

    return mysql_num_rows($rid);
    }

    function insert_id()
    { return mysql_insert_id();
    }

    function disconnect($con='1')
    { if($con == '1')
    { $con = $this->defaultcon;
    }
    mysql_close($con);
    }

    function insert($data)
    { foreach($data as $n => $v)
    {
    $columns[] = $n;
    $rows[] = "'" . addslashes($v) . "'";

    }
    return array (
    'columns' => implode(",", $columns),
    'values' => implode(",", $rows),
    );
    }

    function update($data)
    {
    foreach($data as $n => $v)
    { $output[] = "$n='".addslashes($v)."'"; }

    return implode(",", $output);
    }

    function error($error=1, $q, $con="")
    { if($error == 1)
    { $error = mysql_error(); }

    if($con == "" OR is_numeric($con))
    { $con = $this->default;
    }

    if($this->query == "")
    { $this->query = "N/A"; }
    $time = date('l dS F Y, g:iA', time());

    print <<<data
    <html>
    <head>
    <title>Monster Top List Fatal Error</title>
    </head>
    <body>
    <font size='4'><b>Fatal MySQL Error in Monster Top List 1.4</b></font><br>
    A fatal MySQL Error has occured. Please contact the list owner with the information in the text box below.
    <br><br>
    <textarea cols='80' rows='10' noscrolling>MySQL Error: {$error}

    Query: {$q}

    Connection: {$con}

    Time: {$time}
    </textarea>
    </body>
    </html>
    data;
    exit;
    }

    function escape($string)
    {
    return mysql_escape_string($string);
    }
    }

    ?>

  2. # ADS




     

  3. #2
    عضو جدید S4n470n آواتار ها
    تاریخ عضویت
    Sep 2010
    محل سکونت
    Unix
    نوشته ها
    85
    تشکر تشکر کرده 
    0
    تشکر تشکر شده 
    70
    تشکر شده در
    49 پست

    پیش فرض پاسخ : مشکل در وارد کردن اطلاعات

    خط 12 رو باید تکمیل کنی
    کد PHP:
    function connect($host,$user,$pass,$db,$pfx,$con_name,$def0
    البته اینجا مقادیر رو شاید از فایل دیگه می خونه
    این فایل مربوط به چه اسکریپتی هست؟
    !... Security is never complete

اطلاعات موضوع

کاربرانی که در حال مشاهده این موضوع هستند

در حال حاضر 1 کاربر در حال مشاهده این موضوع است. (0 کاربران و 1 مهمان ها)

مجوز های ارسال و ویرایش

  • شما نمیتوانید موضوع جدیدی ارسال کنید
  • شما امکان ارسال پاسخ را ندارید
  • شما نمیتوانید فایل پیوست کنید.
  • شما نمیتوانید پست های خود را ویرایش کنید
  •