【php开源代码栏目提醒】:网学会员--在 php开源代码编辑为广大网友搜集整理了:showdata.php绩等信息,祝愿广大网友取得需要的信息,参考学习。
<?php require_once('Connections/ConnClass.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_ConnClass, $ConnClass);
$query_RecClassMates = "SELECT * FROM classmates";
$RecClassMates = my
sql_query($query_RecClassMates, $ConnClass) or die(
mysql_error());
$row_RecClassMates = mysql_fetch_assoc($RecClassMates);
$totalRows_RecClassMates = mysql_num_rows($RecClassMates);
?><!DOCTYPE html PUBLIC "-//W3C//DTD X
HTML 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=gb2312" />
<title>无标题
文档</title>
</head>
<body>
<table border="1" cellpadding="2" cellspacing="1">
<tr>
<td>classID</td>
<td>className</td>
<td>classSex</td>
<td>classBirthday</td>
<td>classEmail</td>
<td>classPhone</td>
<td>classAddress</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_RecClassMates['classID']; ?></td>
<td><?php echo $row_RecClassMates['className']; ?></td>
<td><?php echo $row_RecClassMates['classSex']; ?></td>
<td><?php echo $row_RecClassMates['classBirthday']; ?></td>
<td><?php echo $row_RecClassMates['classEmail']; ?></td>
<td><?php echo $row_RecClassMates['classPhone']; ?></td>
<td><?php echo $row_RecClassMates['classAddress']; ?></td>
</tr>
<?php } while ($row_RecClassMates = mysql_fetch_assoc($RecClassMates)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($RecClassMates);
?>