C
cmg
Mitglied
Hi,
ich habe folgende Abfrage:
Unter Windows bekomm ich das gewünschte Ergebnis, unter Linux (mit den identischen Datei) bekomm ich $result == false.
Ich habe vorhin den selben Fehler schon mal gehabt und da lag es daran, dass ich statt dem Tabellennamen "Date" "DATE" schrieb.
Ich fürchte irgendwie sowas Spitzfindiges ist es hier auch.
Anbei die Sturktur wie ich sie in MySQL reingehauen habe:
ich habe folgende Abfrage:
PHP:
$sql = "SELECT MAX(MU), Date FROM(SELECT COUNT(UserMeeting.UserID) AS 'MU', Date.Date, Date.Avail FROM UserMeeting, Meeting, User, Date WHERE Meeting.MeetingID = UserMeeting.MeetingID AND UserMeeting.UserID = User.UserID AND User.UserID = Date.UserID AND Date.Avail = '1' AND Date.Date >= NOW() AND Meeting.MeetingID = '$meetingid' GROUP BY Date.Date) MAXU";
$result = mysql_query($sql);
Ich habe vorhin den selben Fehler schon mal gehabt und da lag es daran, dass ich statt dem Tabellennamen "Date" "DATE" schrieb.
Ich fürchte irgendwie sowas Spitzfindiges ist es hier auch.
Anbei die Sturktur wie ich sie in MySQL reingehauen habe:
PHP:
CREATE DATABASE Calendar;
use Calendar;
CREATE TABLE IF NOT EXISTS User
(
UserID int (5) NOT NULL AUTO_INCREMENT,
UserName CHAR(30) NOT NULL,
PRIMARY KEY (UserID)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS Meeting
(
MeetingID int (5) NOT NULL AUTO_INCREMENT,
MeetingName CHAR(30) NOT NULL,
MeetingDate DATE NOT NULL,
PRIMARY KEY (MeetingID)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS Date
(
DateID int (5) NOT NULL AUTO_INCREMENT,
Date DATE NOT NULL,
UserID int (5) NOT NULL,
Avail BOOL NOT NULL,
PRIMARY KEY (DateID),
FOREIGN KEY(UserID) REFERENCES User(UserID) ON DELETE CASCADE
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS UserMeeting
(
UserID int (5) NOT NULL,
MeetingID int (5) NOT NULL,
FOREIGN KEY(UserID) REFERENCES User(UserID) ON DELETE CASCADE,
FOREIGN KEY(MeetingID) REFERENCES Meeting(MeetingID) ON DELETE CASCADE
) ENGINE=InnoDB;