Jump to content

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++;
	}
	}

  }

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.