prob with code(class)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
forgun
Forum Commoner
Posts: 61
Joined: Wed Jan 29, 2003 6:05 am
Contact:

prob with code(class)

Post 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:
Last edited by forgun on Tue May 13, 2003 4:45 pm, edited 1 time in total.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

uninstall php. that should remove the problem. :wink:


hehe, jk, it would help to post an error messege
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

no symptoms, no description, no goal, no reason to help...
i have a prob with my code
certainly ;)
Post Reply