Jump to content

[SOLVED] Adding text to a variable already defined


twilitegxa

Recommended Posts

How can I add soem text to display to this variable? I currently have an if statement to make the variable diaply as blank if the value is null or zero, but if the variable does contain a value, I want the text "(for Sailor Scout Attack)" to display after the value. Like here is the variable and how I want it to display, I just don't have it added to the variable right:

 

acv2 = $derived_info['acv2'] + '(for Sailor Scout Attack)';

 

Here is the rest of the statement so you can see the if statement:

 

//gather derived values
$get_derived = "select * from derived_values where identity = '$identity'";

$get_derived_res = mysql_query($get_derived, $conn) or die(mysql_error());

while ($derived_info = mysql_fetch_array($get_derived_res)) {
$health = $derived_info['health'];
$energy = $derived_info['energy'];
$acv1 = $derived_info['acv1'];
$acv2 = $derived_info['acv2'];
$dcv1 = $derived_info['dcv1'];
$dcv2 = $derived_info['dcv2'];
$total_cp = $derived_info['total_cp'];

if($health == 0 || $health == '0' || $health == null){$GLOBALS['health'] = "";}
if($energy == 0 || $energy== '0' || $energy == null){$GLOBALS['energy'] = "";}
if($acv1 == 0 || $acv1 == '0' || $acv1 == null){$GLOBALS['acv1'] = "";}
if($acv2 == 0 || $acv2 == '0' || $acv2 == null){$GLOBALS['acv2'] = "";}
if($dcv1 == 0 || $dcv1 == '0' || $dcv1 == null){$GLOBALS['dcv1'] = "";}
if($dcv2 == 0 || $dcv2 == '0' || $dcv2 == null){$GLOBALS['dcv2'] = "";}
if($total_cp == 0 || $total_cp == '0' || $total_cp== null){$GLOBALS['total_cp'] = "";}

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.