Jump to content

[SOLVED] need result to show bold?


sandbudd

Recommended Posts

Here is what I am trying to do... First off the code works fine with one exception.  If feature2=1 then I would like to have venue display bold. If it does not =1 then display text not bold.  Here are both files that I am using. As you can see from the code it displays the venue then displays the number 1 in bold next to it. Thanks in advance

 


<?php error_reporting(E_ALL);
ini_set('display_errors', '1');
?>

<?php
$hostname_efw = "";
$database_efw = "";
$username_efw = "";
$password_efw = "";


$efw = mysql_pconnect($hostname_efw, $username_efw, $password_efw) or trigger_error(mysql_error(),E_USER_ERROR); 
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$maxRows_Recordset1 = 10000000;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
  $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;

mysql_select_db($database_efw, $efw);
$query_Recordset1 = "SELECT * FROM efw WHERE efw.outdoor=1 AND efw.feature2=1 ";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $efw) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);

if (isset($_GET['totalRows_Recordset1'])) {
  $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
  $all_Recordset1 = mysql_query($query_Recordset1);
  $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

mysql_select_db($database_efw, $efw);
$query_Recordset1 = "SELECT * FROM efw WHERE outdoor = 'y' ORDER BY venue ASC";
$Recordset1 = mysql_query($query_Recordset1, $efw) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>

<?php include "display.php" ?>


<?php
mysql_free_result($Recordset1);
?>


 


<?php do { ?>
  <tr>
    <td width="195"><span class="style3"><?php echo $row_Recordset1['venue']; ?></span>
    <span class="style4"><?php echo $row_Recordset1['feature2']; ?></span><br />
        <span class="style3"><?php echo $row_Recordset1['address']; ?></span><br />
        <span class="style3"><?php echo $row_Recordset1['city']; ?></span><span class="style3">,</span><span class="style3"><?php echo $row_Recordset1['state']; ?></span><br />
        <span class="style3"><?php echo $row_Recordset1['phone']; ?></span><br />
        <span class="style3">
        <?php
if(empty($row_Recordset1['website'])){
   //empty() returned true : so there is nothing
   echo 'Website';
}else{
   //empty() returned false so it is NOT true that there is nothing
   //so we can print it out:
   echo '<a href="http://' . $row_Recordset1['website'] . '"  target="_blank" class="style3">Website</a>';
}
?>
          |
          <?php
if(empty($row_Recordset1['email'])){
   //empty() returned true : so there is nothing
   echo 'Email';
}else{
   //empty() returned false so it is NOT true that there is nothing
   //so we can print it out:
   echo '<a href="mailto:' . $row_Recordset1['email'] . '"  target="_blank" class="style3">Email</a>';
}
?>
          |
          <?php
if(empty($row_Recordset1['coupon'])){
   //empty() returned true : so there is nothing
   echo 'Coupon';
}else{
   //empty() returned false so it is NOT true that there is nothing
   //so we can print it out:
   echo '<a href="/images/coupon/' . $row_Recordset1['coupon'] . '"  target="_blank" class="style3">Coupon</a>';
}
?>
        </span> | <span class="style3">
        <?php
if(empty($row_Recordset1['menu'])){
   //empty() returned true : so there is nothing
   echo 'Menu';
}else{
   //empty() returned false so it is NOT true that there is nothing
   //so we can print it out:
   echo '<a href="/images/menu/' . $row_Recordset1['menu'] . '"  target="_blank" class="style3">Menu</a>';
}
?>
      </span> <br />
      <span class="style3">
<?php
if(empty($row_Recordset1['map'])){
   //empty() returned true : so there is nothing
   echo 'Directions';
}else{
   //empty() returned false so it is NOT true that there is nothing
   //so we can print it out:
  echo '<a href="javascript://" onClick="popupfunction(\'/images/map/' . $row_Recordset1['map'] . '\');"   class="style3">Directions</a>';
}
?>
      </span></td>
    <td width="104" colspan="4" align="center" valign="middle"></td>
  </tr>
  <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>

Link to comment
https://forums.phpfreaks.com/topic/175381-solved-need-result-to-show-bold/
Share on other sites

got it guys changed to this works perfect

 

<?php do { ?>
  <tr>

  
    <td width="195"><span class="style3"></span>
    <span class="style4"><?php
if ($row_Recordset1['feature2'] == 1)
{
echo "<span class=styleX>";
}
else
{
echo "<span class=style3>";
}
echo $row_Recordset1['venue'];
?>

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.