语法错误,意外'更新' [英] Syntax error,unexpected 'Update'

查看:81
本文介绍了语法错误,意外'更新'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我是Php的初学者。



我连接数据库并获取数据它返回正常。

这里我用链接按钮通过php创建了表但是它在更新时给出语法错误

我不知道我哪里出错了。

那么,任何人都可以解决这个问题吗?



这里我的PHP代码是



Hi all,

Im beginner of Php.

I connect the database and fetch the data it's returning fine.
here I created table with Link buttons through php but it's giving syntax error in update
I don't know where I went wrong.
So, Can anyone solve this?

here my php code is

<?php

mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db("Sample") or die(mysql_error());
$result = mysql_query("Select * from Test_Table") or die(mysql_error());

echo "<table border=\"1\" align=\"1\">";
echo "<tr><th>Test Name </th>";
echo "<th> Test Description </th>";
echo "<th> Test Phone Number </th>";
echo "<th> Insert </th>";
echo "<th> Edit </th>";
echo "<th> Delete </th></tr>";
while($row=mysql_fetch_array($result))
{
    echo "<tr><td>";
    echo $row['TestName'];
    echo "</td>";
    echo "<td>";
    echo $row['TestDescription'];
    echo "</td>";
    echo "<td>";
    echo $row['TestPhoneNo'];
    echo "</td>";
    echo "<td>";
    echo "<a href='Insert.php'>Insert</a>";
    echo "</td>";
    echo "<td>";
    echo "<a href="Update.php?Updates=$row['TestId']">Update</a>";
    echo "</td>";
    echo "<a href="Delete.php?id=$row['TestId']">Delete</a>";
    echo "</td></tr>";
}
echo "</table>"

?>

推荐答案

结果 = mysql_query( 从Test_Table中选择* die(mysql_error());

echo < table border = \1 \align = \1 \>;
echo < tr>< th>测试名称< / th>;
echo < th>测试说明< /第>中;
echo < th>测试电话数字< / th>;
echo < th> Insert< ; /第>中;
echo < th>编辑< ; /第>中;
echo < th>删除< ; /个GT&;< / TR GT&;;
while(
result = mysql_query("Select * from Test_Table") or die(mysql_error()); echo "<table border=\"1\" align=\"1\">"; echo "<tr><th>Test Name </th>"; echo "<th> Test Description </th>"; echo "<th> Test Phone Number </th>"; echo "<th> Insert </th>"; echo "<th> Edit </th>"; echo "<th> Delete </th></tr>"; while(


row = mysql_fetch_array(
row=mysql_fetch_array(


result))
{
echo < tr>< td>;
echo
result)) { echo "<tr><td>"; echo


这篇关于语法错误,意外'更新'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆