Jump to content

echo from database


almightyegg

Recommended Posts

I have a persons profile page and they have an option of 3 custom fields, and this sees if they have filled anything in or not etc:
[code=php:0]
<? if($profile['customt1'] == 0){}else{ ?>
<tr><td valign="top"><b><? echo "$profile[customt1]"; ?></b> </td>
<td valign="top"><? echo "<p>$profile[customtext1]</p>"; ?></td></tr>

<? } if($profile['customt2'] == 0){}else{ ?>
<tr><td valign="top"><b><? echo "$profile[customt2]"; ?></b></td>
<td valign="top"><? echo "<p>$profile[customtext2]</p>"; ?></td></tr>

<? } if($profile['customt3'] == 0){}else{ ?>
<tr><td valign="top"><b><? echo "$profile[customt3]"; ?></b> </td>
<td valign="top"><? echo "<p>$profile[customtext3]</p>"; ?></td></tr>
<? } ?>
</table>
[/code]

hellllppp!!  ???
Link to comment
https://forums.phpfreaks.com/topic/34313-echo-from-database/
Share on other sites

no change in anything  ??? everything is exactly the same...it's an error in this i think:
[code=php:0]
<? if($profile['customt1'] == 0){echo gah;}else{ ?>
<tr><td valign="top"><b><? echo "$profile[customt1]"; ?></b> </td>
<td valign="top"><? echo "<p>$profile[customtext1]</p>"; ?></td></tr>

<? } if($profile['customt2'] == 0){echo gah;}else{ ?>
<tr><td valign="top"><b><? echo "$profile[customt2]"; ?></b></td>
<td valign="top"><? echo "<p>$profile[customtext2]</p>"; ?></td></tr>

<? } if($profile['customt3'] == 0){echo gah;}else{ ?>
<tr><td valign="top"><b><? echo "$profile[customt3]"; ?></b> </td>
<td valign="top"><? echo "<p>$profile[customtext3]</p>"; ?></td></tr>
<? } ?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/34313-echo-from-database/#findComment-162265
Share on other sites

I thought it may be to do with layout of it so i changed it to this:
[code=php:0]
<?
if($profile['customt1']==0){
echo "gah";
}else{
?>
<tr><td valign="top"><b><? echo "$profile[customt1]"; ?></b> </td>
<td valign="top"><? echo "<p>$profile[customtext1]</p>"; ?></td></tr>

<?
}
if($profile['customt2']==0){
echo "gah";
}else{
?>
<tr><td valign="top"><b><? echo "$profile[customt2]"; ?></b></td>
<td valign="top"><? echo "<p>$profile[customtext2]</p>"; ?></td></tr>

<?
}
if($profile['customt3']==0){
echo "gah";
}else{
?>
<tr><td valign="top"><b><? echo "$profile[customt3]"; ?></b> </td>
<td valign="top"><? echo "<p>$profile[customtext3]</p>"; ?></td></tr>
<? } ?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/34313-echo-from-database/#findComment-162283
Share on other sites

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.