project/
├── api/
│ └── matches.php
├── assets/
│ ├── css/
│ │ └── style.css
│ └── images/
│ ├── team1.png
│ └── team2.png
└── index.html
جدول المباريات
جدول المباريات
صورة الفريق الأول |
اسم الفريق الأول |
نتيجة الفريق الأول |
الوقت |
نتيجة الفريق الثاني |
اسم الفريق الثاني |
صورة الفريق الثاني |
القناة الناقلة |
معلق المباراة |
الدوري |
رابط المباراة |
.match-table img {
width: 50px;
height: 50px;
border-radius: 50%;
}
.match-table th, .match-table td {
text-align: center;
vertical-align: middle;
}
.match-table tbody tr:nth-child(even) {
background-color: #f8f9fa;
}
.match-table tbody tr:hover {
background-color: #e9ecef;
transition: 0.3s;
}
connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// جلب البيانات من الجدول
$sql = "SELECT * FROM matches";
$result = $conn->query($sql);
$matches = [];
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$matches[] = $row;
}
}
// إرجاع البيانات كـ JSON
header('Content-Type: application/json');
echo json_encode($matches);
// إغلاق الاتصال
$conn->close();
?>
CREATE DATABASE football_matches;
USE football_matches;
CREATE TABLE matches (
id INT AUTO_INCREMENT PRIMARY KEY,
team1_name VARCHAR(255) NOT NULL,
team1_img VARCHAR(255) NOT NULL,
team1_score INT DEFAULT 0,
team2_name VARCHAR(255) NOT NULL,
team2_img VARCHAR(255) NOT NULL,
team2_score INT DEFAULT 0,
match_time DATETIME NOT NULL,
channel VARCHAR(255),
commentator VARCHAR(255),
league VARCHAR(255),
match_link VARCHAR(255)
);
INSERT INTO matches (team1_name, team1_img, team1_score, team2_name, team2_img, team2_score, match_time, channel, commentator, league, match_link)
VALUES
('فريق 1', 'team1.png', 2, 'فريق 2', 'team2.png', 1, '2024-12-10 20:30:00', 'قناة 1', 'المعلق 1', 'الدوري الممتاز', 'https://example.com'),
('فريق 3', 'team3.png', 1, 'فريق 4', 'team4.png', 3, '2024-12-11 18:00:00', 'قناة 2', 'المعلق 2', 'الدوري الإسباني', 'https://example2.com');
إرسال تعليق