誰かが私を助けることができたら文法に苦しんでいます。上記の値がある場合php/mysqlコードの正しい構文
条件1 = $ncha['p_no_contacts']-$ncha['r_cnt']
の値がある場合は、その後、と言っh1
セクションに余分なエコーを追加「あなたは最後の連絡先の詳細を表示しているし、あなたのメンバーシップを使い果たしてしまった。あなたのメンバーシップを更新してください」 より、1つのecho文をそのまま使用してください。
次のことは、誰かが助けることができる場合、私は正しい構文を必要とする支払いのテーブルを更新するか、または$inc1
が$ncha['p_no_contacts']
と等しい場合は支払いのテーブルから行を削除することです。
EDIT:
これは私が試したものですが、私はelse
文のh1
行でエラーParse error: syntax error, unexpected '>' on line 51
を取得します。あなたが一緒にHTMLやPHPのコードを混合している
おかげ
<div class="modal-dialog yoyo-large">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×
</button>
if $ncha['p_no_contacts']-$ncha['r_cnt'] = 1
{
<h1 class="modal-title" id="myModalLabel" style="color:red;">Remaining Contacts (
<?php echo ($ncha['p_no_contacts']-$ncha['r_cnt']);?>)
</h1>
}
else
{
<h1 class="modal-title" id="myModalLabel" style="color:red;">Remaining Contacts (
<?php echo ($ncha['p_no_contacts']-$ncha['r_cnt']) <br> You are viewing last contact details and have exhausted your membership. Please renew your membership;?>)
</h1>
</div>
<div class="modal-body">
<div class="col-sm-12 form-group">
<div class="col-sm-6" style="font-size:13px;">
<table class="table table-hover table-striped">
<tr height="30">
<td width="80">
<strong>Matri ID :
</strong>
</td>
<td>
<?php echo $fet['matri_id']; ?>
</td>
</tr>
<tr height="30">
<td>
<strong>Name :
</strong>
</td>
<td>
<?php echo $fet['username']; ?>
</td>
</tr>
<tr height="30">
<td>
<strong>Address :
</strong>
</td>
<td>
<?php echo $fet['address']; ?>
</td>
</tr>
<tr height="30">
<td>
<strong>Phone :
</strong>
</td>
<td>
<?php echo $fet['phone']; ?>
</td>
</tr>
<tr height="30">
<td>
<strong>Mobile :
</strong>
</td>
<td>
<?php echo $fet['mobile']; ?>
</td>
</tr>
<tr height="30">
<td>
<strong>Email :
</strong>
</td>
<td>
<?php echo $fet['email']; ?>
</td>
</tr>
</table>
</div>
</div>
<?php
$chk1=$ncha['r_cnt'];
$inc1=$chk1+1;
If $inc1 = $ncha['p_no_contacts']
(
$dele="delete from payments where (pemail='$mid' or pmatri_id='$mid')";
$de=mysql_query($dele) or die(mysql_error());
}
else
{
$upda="update payments SET r_cnt='$inc1' where (pemail='$mid' or pmatri_id='$mid')";
$up=mysql_query($upda) or die(mysql_error());
}
$ex=mysql_query("select id from today_contact where who='$mid' and whose='$from_id'");
if(mysql_num_rows($ex)==0)
{
mysql_query("insert into today_contact (who,whose,on_date) values ('$mid','$from_id',now())");
}
else
{
mysql_query("update today_contact set on_date=now() where who='$mid' and whose='$from_id'");
}
?>
</div>
</div>
</div>
[if](http://php.net/if)のやり方は何ですか? –
はい..私は試みましたが、構文が間違っていると思われる場合は、中かっこまたはコマンド内のコマンド自体に問題があるかもしれません。私は論理を知っていますが、構文を理解していません。 – Sabha
私たちが助けることができるものを提供しなければ、私たちはお手伝いできません。 –