Page 1 of 1

prob with code(class)

Posted: Tue May 13, 2003 2:45 pm
by forgun

Code: Select all

<?php
/* 
    the function that get the info need to print
    it's from a class i miss few part but that is the functions
*/
function get_data() {
        config::connect();
        $qur = "SELECT  `a.id` , `s.id` , `s.r_id` , `s.words` ,`a.title` , `body` , `by` , `b-date`"
		  ."FROM  `article a` , `words s`  ORDER BY  `title` ASC LIMIT 15";
        $res = mysql_query($qur) or die (config::diemsg(0)."<br><center>******Error******<br>".mysql_error()."</center>");
        while ($row = mysql_fetch_object($res)) {
            $this->data = array (
            'title' => $row->title ,
            'body' => $row->body ,
            'by' => $row->by ,
            'date' => $row->b-date ,
            'words' => array($row->words) ,
            'id' => $row->id
            );
       }
		com::displaysc($this->data);
    }
/*
   this print the data the prob here is 
   that it's give me one or two chrs in the the print  and know that is the prob in the array but dont kown where   how i can fix this 
   b.s 
   this function is long
*/
function displaysc($data) {
		$j = 1;
        foreach ($this->data as $i=>$val){
            $title = $data[$i]['title'];
            $id = $data[$i]['id'];
            $by = $data[$i]['by'];
            $body = $data[$i]['body'];
            $date = $data[$i]['date'];
            $j++;
        }
        switch ($_GET["act"]) {
            case "main":
            echo "
			<div align="center">
            <table width="734">
                <tr>
                    <th class="cg" width="26" bgcolor="#800000" nowrap>
                    <div lang="he" align="center" class="font_title_cg">no.</div>
                    </th>
                    <th class="cg" width="550" bgcolor="#800000" nowrap>
                    <div align="center" 
                    class="font_title_cg" style="width: 158; height: 19">
                      ëåúøú</div></th>
                    <th  lang="he" class="cg" width="123" bgcolor="#800000" 
                    nowrap>
                    <div lang="he" align="center" class="font_title_cg">
                      úàøéê</div></th>
                </tr>
                <tr>
                    <td class="cg" width="26"
                    bgcolor="#008080" id="call1"><div class="font_body_cg"></div></td>
                    <td class="cg" width="550" 
                    onmousedown="window.location('chnageart.php?id=&act=edit')" 
                    bgcolor="#008080" id="call1"><A href="chnageart.php?id=$id&act=edit"
                    title="article no $i \n bla bla bla" class="font_link_cg">$title</a></td>
                    <td class="cg" width="123" 
                    bgcolor="#008080" nowrap id="call1"><div lang="he" class="font_body_cg">$date</div></td>
                </tr>
                <tr>
                    <td colspan="3" class="cg" width="695" 
                    bgcolor="#800000" nowrap><div lang="he" align="center" class="font_end_cg">
                      ñåó øùéîä</div></td>
                </tr>
            </table>
        </div><br><br><br>
		";
            break;
        }
    }
?>
plz help i dont know what to do and how to fix this :roll:

Posted: Tue May 13, 2003 3:27 pm
by m3mn0n
uninstall php. that should remove the problem. :wink:


hehe, jk, it would help to post an error messege

Posted: Tue May 13, 2003 3:41 pm
by volka
no symptoms, no description, no goal, no reason to help...
i have a prob with my code
certainly ;)