Jump to content

need Help with define() please


richarro1234

Recommended Posts

Hello,

 

Im trying to change some info that has been output from the database,

basically its an interview, and i would like to change the color of the names being output from the database using define.

 

<?
session_start();
include("dbconfig.php");
?>
<?
$query = mysql_query("SELECT * from interviews WHERE bid = '".$_GET['id']."'");
while ($b = mysql_fetch_array($query)) {

$intid = $b['id'];
$interview = $b['interview'];
$bandid = $b['bid'];
$location = $b['location'];
$date = $b['date'];
}
define("E.G.G","<font color=\"ff0000\">E.G.G</font>");
?>
<?
include ("header.php");
?>
  <div id="mainCont">
<div id="leftCol">
      <div id="bandinfo">
        <h3>Location: <?=$location?></h3>
        <p><? echo $interview; ?></p>
      </div>
    </div>
    <div id="centrCol">
      <div id="albmBlock">

 

But this doesnt change the color of "E.G.G".

 

Is there away to do this without having to go into phpmyadmin and adding the <font> tage to every name in there as it is quite a long peice of text?

 

Thanks

Rich

Link to comment
https://forums.phpfreaks.com/topic/189313-need-help-with-define-please/
Share on other sites

As what he said above, define is for constants. A constant means that it is a variable that is meant to be present throughout the life of the entire website and/or application.  Whereas a variable is normally temporary, a constant is meant to contain data or pieces of data and information that will need to be reused various time within the life cycle of an application.

@mchl: 1,2, i had a constant but it just came up with "could not find constant", and now i know why.

3 i thought could only be used when inserting data into a databse, but will give it a go and see what happens

 

@businessman: thanks for clearing that up.

 

Thanks for your help guys

Rich

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.