View Single Post
ישן 13-08-06, 12:10   # 1
Elad-A
הוסטסניון
 
מיני פרופיל
תאריך הצטרפות: May 2006
הודעות: 1,987

Elad-A לא מחובר  

[PHP] צריך עזרה בשאילתה

שלום,

יש לי את הקוד הבא:
PHP קוד:
<? 
class db{  

var 
$db;  

function 
connect($host$username$password$db_name){  

    
$this->db mysql_connect($host,$username,$password)  
        or die(
"שגיאה");  
      
    
mysql_select_db($db_name,$this->db)  
    or die(
"שגיאה");  
      
    }  
function 
query($query
    { 
        
$res mysql_query("blabla"); 
    return 
$res
    } 
function 
fetch_rows() 
    { 
        return 
mysql_fetch_array($res); 
    } 
function 
num_rows() 
    { 
        return 
mysql_num_rows($res); 
    } 

}   
$db = new db;  
$db->connect("localhost","root","","ea2"); 
$db->query("SELECT * FROM ibf_thanks"); 
$rows $db->num_rows(); 
if(
$rows == 0

echo 
"no"

else 

$users=$db->fetch_rows(); 
echo 
$users 

?>
ההתחברות למסד עובדת אך יש בעיה עם השאילתה. תודה לעוזרים.
  Reply With Quote