troubleshooting Question

Call custom function in php and arrange data as attach file

Avatar of MOSTAGHASSI
MOSTAGHASSIFlag for United States of America asked on
PHP
7 Comments1 Solution201 ViewsLast Modified:
Hello;

I retrieve data with a query as a custom function as below:

QUERY

 <?php
		 
	 $query_artandculture = "select tbarticles.articleid,tbarticles.title,substr(tbarticles.articlebody,1,200) as description1,tbphotos.photofilename,tbarticles.deletitem ,tbarticlecategories.catid,tbcategories.parentid,tbarticles.mediastate,tbphotos.altdescription
	 
from  tbarticles 

INNER JOIN tbphotos on tbphotos.articleid = tbarticles.articleid 
INNER JOIN tbarticlecategories on tbarticlecategories.articleid =  tbarticles.articleid
INNER JOIN tbcategories ON tbcategories.catid = tbarticlecategories.catid


where tbarticles.deletitem='1'   AND (tbcategories.parentid ='1' or  tbcategories.parentid ='2' or tbcategories.parentid ='3')


	  ORDER BY tbarticles.articleid desc
LIMIT 8
";

$result_artandculture = mysql_query($query_artandculture);
?>

FUNCTION

function doArticle_image300_artandculture($articleid,$title,$description1,$photo,$parentid,$catid,$mediastate,$altdescription) {
{
    // CREATE A RETURN STRING IN HEREDOC NOTATION
      $tab = <<<EOD
    <div class="wrapper-for-datapakage-firstpage">
      <div class="articletitle"><a href='./$folder/$file?articleid=$articleid&parentid=$parentid&catid=$catid'><strong>$title 
		   </strong></a></div>
      <div class="row2-main-datapakage"><a href='./$folder/$file?articleid=$articleid&parentid=$parentid&catid=$catid'>
		   <img src='./images/mimage/$photo' border='0' alt='$altdescription' /></a><br/></div>
      <div class="row3-main-datapakage">$description1...</div><hr class='hr95'></div>
    </div>
EOD;

    return $tab;
}
		  
          }
          $tab = "";
}

I want that arrange each block of data (call function) as 2 columns and in each row 2 blocks .

Thanks
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros