Jump to content

A small highlighting issue.


David And Evan

Recommended Posts

EDIT: Its only TestPaid with the value of 1 I want to highlight not all of them.

 

 

Well the issue is that I have a business directory website, I have just figured out how to get my stock script (which has been heavily modified by a number of co-workers of mine) to list the paid businesses before the unpaid. The thing I wish to do now is to ad a line of code in the php script below that will make the items which are being printed from the feild TestPaid be highlighted in yellow, ( Hex #FFFF82 ) They are being printed to a list by the way.

 

 

   

  $sql="select  nBusId $ftchflds from iscriptseitbl_product where nCatid='".$var_catid."' ";

          $sql .= $qryopt . " ORDER BY TestPaid DESC, dPostDate DESC";

          //echo "sql==$sql";

          $excsearch=mysql_query($sql) or die("Could Not Exicute:".mysql_error());

          $targetfile="catwiseproducts.php";

 

The above qoute is the php snippet I wish to encorporate it to.

Link to comment
https://forums.phpfreaks.com/topic/140073-a-small-highlighting-issue/
Share on other sites

I'm not really sure if this is what you're after.  But here is how you would print the SQL results in a list with a yellow background.

 

<?php

$sql = "
SELECT 
	nBusId 
	$ftchflds 
FROM 
	iscriptseitbl_product 
WHERE 
	nCatid='".mysql_real_escape_string($var_catid)."' 
";
$sql .= $qryopt . " ORDER BY TestPaid DESC, dPostDate DESC";

$excsearch = mysql_query($sql) or die("Could Not Execute:" . mysql_error());


echo '<ul>';
while ($row = mysql_fetch_assoc($excsearch)) {
	echo '<li style="background-color: #ffff82;">' . $row['TestPaid'] . '</li>';
}
echo '</ul>';

$targetfile = "catwiseproducts.php";

?>

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.