我正在尝试用开发电子邮件地址替换电子邮件地址,以便测试我的电子邮件发送功能。
下面的功能导致我的网页停止响应,当我尝试查看 SQL Server Management 2008 中的表时,我无法。我相信问题出在线路上
$scrub = sqlsrv_query($conn, "UPDATE " . $tName . " SET DCAEmail='test@test.edu'");
不过,我不确定。整个功能:
function scrubEmail($conn){
$tableNameList = array();
$getTableName = sqlsrv_query($conn, "Select Name FROM sys.tables");
while($row = sqlsrv_fetch_array($getTableName)){
if($row['Name'] !== "sysdiagrams"){
$tableNameList[] .= $row['Name'];
}
}
foreach($tableNameList as &$tName){
$hasDCAEmail = sqlsrv_query($conn, "SELECT DCAEmail from " . $tName );
if($hasDCAEmail){
$scrub = sqlsrv_query($conn, "UPDATE " . $tName . " SET DCAEmail='test@test.com'");
if(!$scrub){
die( print_r( sqlsrv_errors(), true));
}
}
}
}