I am trying to make an appointment maker for potential customers. The hours that are available will depend greatly on personal schedules, so I don't want a generic calendar type appointment maker. What I was trying was an SQL DB with 4 columns [ID, Made, Date, Time] with the following types [INT, BIT, VARCHAR, VARCHAR].
When SELECTing my data and displaying it, I am attempting to have an IF statement (PHP) determine if "Made" is "00" or "01" - 00 being "appointment available", 01 being "taken".
The output does display all the rows; however, it is showing all the rows as "appointment available". One of my rows has "01" in the "Made" column, and it is still showing as available.
PHP/SQL Script after connection:
$sql = "SELECT * FROM $tname";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
if ($row["Made"] = '00') {
echo "<tr><td>" . $row["ID"] . "</td><td>" . 'Make An Appointment' . "</td><td>" . $row["Date"] . "</td><td>" . $row["Time"] . "</td></tr>";
}
elseif ($row["Made"] = '01') {
echo "<tr><td>" . $row["ID"] . "</td><td>" . 'Reserved' . "</td><td>" . $row["Date"] . "</td><td>" . $row["Time"] . "</td></tr>";
}
}
}
This is the link to the output on the website:
http://www.jpegchaos.com/appointment.php
I will continue to re-upload the .php with any attempts to see if new information displays.
Line 2 should show "Reserved" while 1 and 3 should be "Make an Appointment"
Thank you in advance