나는 최근에 PHP를 배우기 시작했는데, 아래에 dreamweaver를 통해 아래 쿼리를 만들었습니다.데이터베이스에서 정보를 가져올 수 없습니다.
enter code here
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$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_PMS, $PMS);
$query_rs_home = "SELECT * FROM hotelinfo, hotelslider WHERE hotelinfo.hotelid=hotelslider.id";
$rs_home = mysql_query($query_rs_home, $PMS) or die(mysql_error());
$row_rs_home = mysql_fetch_assoc($rs_home);
$totalRows_rs_home = mysql_num_rows($rs_home);
?>
이 코드를 사용하는 경우 데이터베이스의 첫 번째 레코드 만 표시됩니다. 나는 더 이상의 기록을 얻지 못하고있다.
제발 도와주세요.
내가 hotelid으로 'FIELD_NAME'를 사용할 수 있습니다 $ row_rs_home – acutesoftware