2016-07-01 3 views
-6

パースエラー

<?php 
 
error_reporting(E_ALL); 
 
$con=mysql_connect("localhost","root",""); 
 
$db=mysql_select_db("TB_DB",$con); 
 

 
if(isset($_POST['submit'])) 
 
{ 
 
\t $sql="INSERT INTO `tv-circuits` (`part-name`, `model-no`, `price`) VALUES ('".$_POST['prt-name']."', '".$_POST['mdl-no']."', '".$_POST['price']."')"; 
 
\t 
 
$res=mysql_query($sql); 
 

 
?> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml"> 
 
<head> 
 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
 
<title>Anirudha's TV appliances</title> 
 
</head> 
 
<h1 align="center"><strong>Admin Panel</strong></h1> 
 
<body> 
 
<form action="" method="post"> 
 
<table align="center"> 
 
<tr><td>Enter Part Name </td><td><input type="text" name="prt-name" /></td></tr> 
 
<tr><td>Enter Model-No </td><td><input type="text" name="mdl-no" /></td></tr> 
 
<tr><td>Enter Price</td><td><input type="number" name="price" /></td></tr> 
 
<tr align="center"><td colspan="2"><input type="submit" value="Save-Data" name="submit" /></td></tr> 
 
</table> 
 
</form><br /> 
 
<table border="1" align="center"> 
 
<tr align="center"> 
 
<td width="67"><strong>Sr.no</strong></td> 
 
<td width="143"><strong>Part-Name</strong></td> 
 
<td width="143"><strong>Model-No</strong></td> 
 
<td width="93"><strong>Price</strong></td> 
 
<td width="125"><strong>Operations</strong></td> 
 
</tr> 
 
<?php 
 
$i=1; 
 
$sql="SELECT * from tv-circuits"; 
 
$res=mysql_query($sql); 
 
while($row=mysql_fetch_array($res)) 
 
{ 
 
?> 
 
<tr> 
 
<td><?php echo $row['i'];?></td> 
 
<td><?php echo $row['part-name'];?></td> 
 
<td><?php echo $row['model-no'];?></td> 
 
<td><?php echo $row['price'];?></td> 
 
<td align="center"><a href="index.php?viewid=<?php echo $row['part-name'];?>" ><strong>VIEW</strong></a> 
 
<a href="index.php?delid=<?php echo $row['part-name'];?>" ><strong>DELETE</strong></a> 
 
<a href="index.php?editid=<?php echo $row['part-name'];?>" ><strong>EDIT</strong></a></td> 
 
</tr> 
 

 
<?php $i=$i+1; }?> 
 
</table> 
 
</body> 
 
</html>

私は、更新を表示し、ユーザーを削除しますAAのページを作成していますが、私はこのエラーを取得していますHTMLページ

値を入力...

Parse error: syntax error, unexpected $end in C:\wamp\www\TV-DB\index.php on line 56

すべての可能性を確認しましたが、このエラーがどのように発生したかはわかりません。

ページのコーディングは、あなたが上記if句の}を閉じるのを忘れているこの...

Image is showing the error in the code

+1

エラーを教えてください。また実際にここにコードを貼り付けることができますか? – MuthaFury

+0

あなたは画像内にコードを投稿しないでください –

+0

コードを投稿し、すべての処理方法と完全なエラーメッセージ –

答えて

1

です。 HTMLの後に閉じてください。

<?php $i=$i+1; }?> 
</table> 
</body> 
</html> 
<?php 
} 
?> 
+0

そんなにメガンありがとうございました...☺☺問題は解決しました..! –

+0

あなたは答えを受け入れることで感謝します.. –