how to fix the error in line 41....plz help me

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    how to fix the error in line 41....plz help me

    PHP Code:
    <?php
    
    
    class Gift {
    
        // define properties
        public $gid;
        public function __construct() {
            $this->gid = null;
            $this->fields = array(     'title' => '',
                                    'image' => '',
                                    'price' => 0,
                                    'category_title' => '');
        }
    
        // return an object populated based on the record's user id
        public static function getById($gift_id) {
    
            $gift = new Gift();
    
            $row = mysql_fetch_assoc($res);
    
            $gift->gid = $gift_id;
            $gift->image = $row[gImage];
            $gift->price = $row[gPrice];
            $gift->hit = $row[gHit];
            $gift->category = $row[gCat];
        
            $rs = query("SELECT * FROM `gifts_category` WHERE `catid`=$row[gCat]");
            $rw = mysql_fetch_assoc($rs);
    
            $gift->category_title = $rw[catTitle];
    
            mysql_free_result($res);
            return $gift;
        }
    
        // save the record to the database
        public function save() {
    
                    `gTitle`=\"$this->title\",
                    `gImage`=\"$this->image\",
                    `gPrice`=$this->price,
                    `gHit`=$this->hit,
                    `gCat`=$this->category
                         WHERE `gid`=$this->gid");
            }
        }
    
    }
    
    ?>

    #2
    Brother there is a ")" sign in line no 46,where is "(" this sign.
    Originally posted by hidden
    Code:
    <?php 
    
    
    class Gift { 
    
        // define properties 
        public $gid; 
        public function __construct() { 
            $this->gid = null; 
            $this->fields = array(     'title' => '', 
                                    'image' => '', 
                                    'price' => 0, 
                                    'category_title' => ''); 
        } 
    
        // return an object populated based on the record's user id 
        public static function getById($gift_id) { 
    
            $gift = new Gift(); 
    
            $row = mysql_fetch_assoc($res); 
    
            $gift->gid = $gift_id; 
            $gift->image = $row[gImage]; 
            $gift->price = $row[gPrice]; 
            $gift->hit = $row[gHit]; 
            $gift->category = $row[gCat]; 
         
            $rs = query("SELECT * FROM `gifts_category` WHERE `catid`=$row[gCat]"); 
            $rw = mysql_fetch_assoc($rs); 
    
            $gift->category_title = $rw[catTitle]; 
    
            mysql_free_result($res); 
            return $gift; 
        } 
    
        // save the record to the database 
        public function save() { 
    
                   `gTitle`="$this->title\",
                    [B][COLOR="#ff0000"]`gImage`="$this->image\", [/COLOR][/B]
                    `gPrice`=$this->price, 
                    `gHit`=$this->hit, 
                    `gCat`=$this->category 
                         WHERE `gid`=$this->gid"); 
            } 
        } 
    
    } 
    
    ?>
    red line is line 41

    but error fixed may b try code

    Comment


      #3
      yes bro...

      Added after 3 minutes:

      itz a facebook gift store application script.that script was full of bugs.i fixed most of them without Gift.php page.if anybody interested tell me i will send u that script ,if u can fix it then send me a copy also
      Last edited by godfathersis; 13.02.11, 15:08.

      Comment


        #4
        PHP Code:
        <?php
        
        class Gift { 
        
            // define properties 
        
            public $gid; 
        
            public function __construct() { 
                $this->gid = null; 
                $this->fields = array(     
                        'title' => '', 
                        'image' => '', 
                                        'price' => 0, 
                                        'category_title' => ''
                        ); 
            } 
        
            // return an object populated based on the record's user id 
        
            public static function getById($gift_id) { 
                $gift = new Gift(); 
                $row = mysql_fetch_assoc($res); 
                $gift->gid = $gift_id; 
                $gift->image = $row["gImage"]; 
                $gift->price = $row["gPrice"]; 
                $gift->hit = $row["gHit"]; 
                $gift->category = $row["gCat"];      
                $rs = query("SELECT * FROM `gifts_category` WHERE `catid`=$gift->category"); 
                $rw = mysql_fetch_assoc($rs); 
                $gift->category_title = $rw["catTitle"]; 
                mysql_free_result($res); 
                return $gift; 
            } 
        
            // save the record to the database 
            public function save() { 
               mysql_query("UPDATE 'gifts_category' SET 
                        `gTitle` = ".$this->title.",
                        `gImage` = ".$this->image.", 
                        `gPrice` = $this->price, 
                        `gHit`   = $this->hit, 
                        `gCat`   = $this->category 
                         WHERE `gid` = $this->gid"); 
                } 
            } 
        
        
        ?>

        Here you go i fixed all the errors i could find

        Comment

        Working...
        X