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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.