Jump to content

[SOLVED] dynamically printing out a porfolio


lional

Recommended Posts

Hi All

I have a site that allows the user to dynamically add there services, adds a text file, and four images.

I now need to write a portfolio where I want it to list the service name, and then show four images per line and then to skip to the next line. it must then show the next service.

But what is happening is that it is showing the services right under each other and then it is showing the images. here is my code

<table width="790" align="left" bgcolor="#0a428d" cellpadding="0" cellpadding="0" height="450">
  <tr><td>
  <table width="196" align="left" bgcolor="#0a428d" cellpadding="0" cellspacing="3" height="450"><br><br>
  <?php

$query = "SELECT * from services ORDER BY service";
$result = mysql_query($query, $conn);
while ($row = mysql_fetch_assoc($result)){
$service_id_out = $row["service_id"];
$service_out = $row["service"];
  $count=1;
  $query_count = "SELECT * from portfolio WHERE category = '$service_id_out' AND active = '1'";
	$result_count = mysql_query($query_count);
	$prt_num_records = @mysql_num_rows($result_count);


	if ($prt_num_records > 0) {
	print '<font color="white" size="4" face="arial">';
	print $service_out;print "<p>";

	$query4 = "SELECT * from portfolio WHERE category = '$service_id_out'"; // display the products in each subcat
	$result4 = mysql_query($query4, $conn);
	while ($row4 = mysql_fetch_assoc($result4)){
	$prodid_out = $row4["portfolio_id"];
	$small_image_out = $row4["small_image"];
	$large_image_out = $row4["large_image"];	
	$num = mysql_num_rows($result4);


			print <<<thumb
	<td width="190" height="140" align="center" valign="top" style="border:0px solid #d2aa64">
	<b><a href="prod_detail.php?prodid=$prodid_out"><img src="images/portfolio/$small_image_out" alt="Blueline Signage" border="0"></a> 
    </td>
thumb;

	if (($count%4) == 0) 
print "</tr><tr>";
$count++;
	}
	}

  }

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.