此帖已被删除

时间:2017-01-13 00:40:18

标签: php mysql

此帖子已被管理员或版主删除。如果您认为这被错误标记,请联系客户支持以获取更多信息。

4 个答案:

答案 0 :(得分:0)

您不必在一个回显中执行所有操作,并且代码缩进使其更易于阅读和调试。

create index ix_concatstr on TABLE (substr(COL, 1, 11) || substr(col_name, 13, 1))

答案 1 :(得分:0)

你没有Echo所有的东西......不是我会怎么做但是下面的例子你不能做一个if语句INSIDE一个echo字符串,但你可以做一个三元操作,即(value == true)?&#34 ;是":"无"但更容易突破脚本并回应你所需要的......

<?
if (!$UserLoggedIn) {

    echo "PLEASE LOGIN";
}else{ 
?>
<div style='background: #FFF;
padding: 25px;
box-shadow: 0 2px 2px #bbb;
margin: auto;
position:relative;
width: 600px;
'>
<center>
Welcome, <? echo $GetLoggedUser->username ?>
  <br>
Here's some statistics about your account:
  <br>
Username: <? echo  $GetLoggedUser->username ?>
  <br>
Email: <? echo $GetLoggedUser->email ?>
  <br>
UserID: <? echo $GetLoggedUser->id ?>
<br>
Banned from game: 
<? if($GetLoggedUser->banned == "0") { echo " no "; } else { echo " yes  ";     } ?>
  <br>
Banned from website: <? echo $GetLoggedUser->Ban ?> (obviously not or this page   wouldn't show up)
<center/>
<div/>
<? } ?>

答案 2 :(得分:0)

要显示更大量的HTML,我希望通过关闭并重新打开PHP代码来切换HTMLPHP

我使用echo<?= ?>)的短语法将PHP中的值插入HTML

某些IDE在HTML封装时无法解释PHP,因此当您使用echo输出syntax highlighting时,他们无法帮助HTML

<?php
if (!$UserLoggedIn) {
    echo "PLEASE LOGIN";
} else {
?>
    <div style='
         background: #FFF;
         padding: 25px;
         box-shadow: 0 2px 2px #bbb;
         margin: auto;
         position:relative;
         width: 600px;
         '>
        <center>
            Welcome, <?= $GetLoggedUser->username ?> 
            <br>
            Here's some statistics about your account:
            <br>
            Username: <?= $GetLoggedUser->username ?>
            <br>
            Email: <?= $GetLoggedUser->email ?>
            <br>
            UserID: <?= $GetLoggedUser->id ?>
            <br>
            Banned from game: <?= $GetLoggedUser->banned == '0' ? ' no ' : ' yes ' ?>
            <br>
            Banned from website: <?= $GetLoggedUser->Ban ?> (obviously not or this page   wouldn't show up)
        </center>
    </div>
<?php
}

答案 3 :(得分:-3)

你仍然可以尝试:  禁止游戏:

if($GetLoggedUser->banned     ==
"0") { echo " no "; } elseif           ($GetLoggedUser->banned       == "1") { echo "
yes "; }