0
예약 시스템을 설계 중입니다. 다른 사용자가 이미 약속을 사용했을 때 데이터베이스에서 약속을 제거하면 (더 이상 표시되지 않음) 어떻게 알 수 있습니까?데이터베이스에서 데이터 제거
<?php
{
mysql_connect("localhost" , "" , "" or die (mysql_error());
mysql_select_db("") or die(mysql_error());
$pid=intval($_SESSION["Patient_id"]); $query = "SELECT t1.*, t2.Doctor_name, t2.Doctor_room FROM Appointment AS t1 INNER JOIN Doctor AS t2 ON t1.Doctor_id=t2.Doctor_id";
//executes query on the database
$result = mysql_query ($query) or die ("didn't query");
//this selects the results as rows
$num = mysql_num_rows ($result);
//if there is only 1 result returned than the data is ok
if ($num == 1) {}
{
$row=mysql_fetch_array($result);
$_SESSION['Appointment_date'] = $row['Appointment_date'];
$_SESSION['Appointment_time'] = $row['Appointment_time'];
$_SESSION['Doctor_name'] = $row['Doctor_name'];
$_SESSION['Doctor_room'] = $row['Doctor_room'];
}
}
위의 코드는 현재 사용자가 약속을 예약 할 수있게합니다. 그것이 찍힌다면 시간과 날짜가 표시되지 않아야합니다.
감사합니다.
그리고 .. 촬영으로
에게 학습을 시작한다 첫 번째 줄을 정정하십시오. mysql_connect ("localhost", "", "") 또는 die (mysql_error()); – alwaysLearn
[mysql_ *] (http://news.php.net/php.internals/53799) 확장 버전은 더 이상 사용되지 않으므로 [PDO] (http://php.net/manual/en/book.pdo)를 사용해야합니다. .php) 또는 [mysqli] (http://php.net/manual/en/book.mysqli.php)를 참조하십시오. – doublesharp
'Appointment'테이블에 대한 내 SQL 구조를 보여줍니다. – shnisaka