הרשם שאלות ותשובות רשימת חברים לוח שנה חיפוש הודעות מהיום סמן פורומים כנקראו

   
|!|

 
 
כלים לאשכול תצורת הצגה
Prev הודעה קודמת   הודעה הבאה Next
ישן 12-08-07, 17:02   # 7
Elad-A
הוסטסניון
 
מיני פרופיל
תאריך הצטרפות: May 2006
הודעות: 1,987

Elad-A לא מחובר  

אממ קח מחלקה שפעם השתמשתי בה:

PHP קוד:
<?php

$db 
= new mysql;

class 
mysql 

    function 
Connect($host$name$pass$db)
    { 
        
$connection mysql_connect($host$name$pass); 
          
mysql_select_db($db$connection); 
    }
 
    function 
FetchRow($query)
    { 
        
$rows mysql_fetch_row($query); 
        return 
$rows
    } 
    function 
FetchArray($query)
    { 
        
$array mysql_fetch_array($query); 
        return 
$array
      } 

    function 
FetchNum($query)
    { 
        
$num mysql_num_rows($query); 
        return 
$num
    } 
  
    function 
Query($sql)
      { 
          
$query mysql_query($sql) or die(mysql_error()); 
          return 
$query
    }
}

?>
בקובץ global.php שלך תשים ככה:

PHP קוד:

// the user name of the mysql data base
$DataBase['user'] = "root";

// the password of the mysql data base
$DataBase['pass'] = "";

// the name of the mysql data base
$DataBase['name'] = "xyz";

// the host of the mysql data base, default: "localhost"
$DataBase['host'] = "localhost";

$DB->Connect($DataBase['host'], $DataBase['user'], $DataBase['pass'], $DataBase['name']); 
ככה זה יחסוך לך התחברות למסד כל פעם, אני מאמין שמפה אתה תסתדר כבר..
  Reply With Quote
 

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 

כלים לאשכול
תצורת הצגה

חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 01:46.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ