Some Help in PHP Code:

Discussion in 'Programming' started by dodo123456, Dec 3, 2008.

  1. #1
    Hi Guys, I have been given a task to convert the code of PHP to Coldfusion. However I am Stuck at this PHp Stuff.

    Please Guide Me

    
    $result = mysql_query("select cid, title, cdesc from  cat where parentid=0 order by title", $link);
    $count =1;
    $displaycat="<tr>";
    while(list($cid, $title, $cdesc) = mysql_fetch_row($result)) {
        $sql=mysql_query("SELECT count(list.listid)  AS totallist, count(cat.cid) as totalcat  FROM list LEFT JOIN cat ON list.cid = cat.cid WHERE list.cid =cat.cid AND cat.parentid='$cid' or cat.cid ='$cid' AND active='1'",$link) or die("Error".mysql_error());
        list($totallist,$totalcat)=mysql_fetch_row($sql);
        $displaycat.="<td class=\"nowconvert\"><br><strong><a href=\"index.php?cid=$cid\">$title ($totallist)</a></strong><br>";
    $result2 = mysql_query("select cid, title from cat where parentid=$cid order by title limit 0,2", $link);
    	$space = 0;
    	while(list($cid, $stitle) = mysql_fetch_row($result2)) {
    		if ($space>0) {
    			$displaycat.=",&nbsp;";
    		}
    	    $cresult2 = mysql_query("select * from list where cid='$cid'", $link);
    	    $cnumrows2 = mysql_num_rows($cresult2);
    		$displaycat.="<a href=\"index.php?cid=$cid\">$stitle</a></span>";
    		$space++;
    	}
    
    PHP:
    I am Confused at this Guys.

    Please help me Guys Thanks

    :(
     
    dodo123456, Dec 3, 2008 IP
  2. tbarr60

    tbarr60 Notable Member

    Messages:
    3,455
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    210
    #2
    Well it looks like some database queries that are looped over to output the data within some HTML table format.

    Get familiar with CFQUERY, CFOUTPUT, and CFIF and you will be most of the way done.
     
    tbarr60, Dec 4, 2008 IP