对于使用DOM的行计数,我们有tablename.rows.length来获取行数,但是我们没有'cols.length'来计算列数.
我们如何找到列数(仅使用DOM)?
以下是我的test.php页面,它从registration.php页面重定向.除了sql查询,这里的一切都很好.所有警报标签都能很好地显示会话变量值,但此页面显示"错误,插入查询失败"错误.尝试了所有可能性,如查询中的变量引用等,但没有任何工作..请有人帮助..
<?php
include "connect.php";
session_start();
$ser= $_SESSION['service'];
$comp=$_SESSION['comp'];
$yr= $_SESSION['year'];
$addr= $_SESSION['addr'];
$per= $_SESSION['per'];
$no= $_SESSION['no'];
$email= $_SESSION['email'];
$uname= $_SESSION['uname'];
echo "<script>alert('$ser')</script>";
echo "<script>alert('$comp')</script>";
echo "<script>alert('$yr')</script>";
echo "<script>alert('$no')</script>";
echo "<script>alert('$addr')</script>";
if($ser=='designing'){
$ser=1;
}else if($ser=='webdev'){
$ser=2;
}else{
$ser=3;
}
echo "<script>alert('$ser')</script>";
$sql= "insert into login values
('$uname','xxxx',$ser,'$comp',$yr,'$addr','$per',$no,'$email')";
mysql_query($sql) or die('Error, insert query failed');
?>
<span style="font-family:Tahoma; font-weight:bold; font-size:11px;color:#666666"
align=center>Your Registration is successful...<br/>Our team will contact you at
the earliest...
</span>
Run Code Online (Sandbox Code Playgroud)