Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''50' OFFSET '0'' at line 1 in D:\xampp\htdocs\vaggelis\devices.php:61 Stack trace: #0 D:\xampp\htdocs\vaggelis\devices.php(61): PDOStatement->execute(Array) #1 {main} thrown in D:\xampp\htdocs\vaggelis\devices.php on line 61
please advise also the db :
-- Host: 127.0.0.1
-- Generation Time: Sep 26, 2024 at 02:28 PM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT /;
/!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS /;
/!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION /;
/!40101 SET NAMES utf8mb4 */;
--
-- Database: tech_store
--
-- Table structure for table customers
CREATE TABLE customers (
id int(11) NOT NULL,
full_name varchar(100) NOT NULL,
landline_phone varchar(20) DEFAULT NULL,
cellphone_number varchar(20) DEFAULT NULL,
registration_date date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Table structure for table customer_devices
CREATE TABLE customer_devices (
id int(11) NOT NULL,
customer_id int(11) NOT NULL,
device_id int(11) NOT NULL,
serial_number varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Table structure for table devices
CREATE TABLE devices (
id int(11) NOT NULL,
type varchar(50) NOT NULL,
brand varchar(50) NOT NULL,
model varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Table structure for table services
CREATE TABLE services (
id int(11) NOT NULL,
customer_id int(11) DEFAULT NULL,
service_number varchar(50) DEFAULT NULL,
service_date date DEFAULT NULL,
comments text DEFAULT NULL,
technician_comments text DEFAULT NULL,
amount_paid decimal(10,2) DEFAULT NULL,
device_id int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Table structure for table settings
CREATE TABLE settings (
id int(11) NOT NULL,
store_name varchar(100) DEFAULT NULL,
address text DEFAULT NULL,
phone_number varchar(20) DEFAULT NULL,
logo_path varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Indexes for dumped tables
--
-- Indexes for table customers
ALTER TABLE customers
ADD PRIMARY KEY (id);
--
-- Indexes for table customer_devices
ALTER TABLE customer_devices
ADD PRIMARY KEY (id),
ADD KEY customer_id (customer_id),
ADD KEY device_id (device_id);
--
-- Indexes for table devices
ALTER TABLE devices
ADD PRIMARY KEY (id);
--
-- Indexes for table services
ALTER TABLE services
ADD PRIMARY KEY (id),
ADD UNIQUE KEY service_number (service_number),
ADD KEY customer_id (customer_id),
ADD KEY device_id (device_id);
--
-- Indexes for table settings
ALTER TABLE settings
ADD PRIMARY KEY (id);
--
-- AUTO_INCREMENT for dumped tables
--
-- AUTO_INCREMENT for table customers
ALTER TABLE customers
MODIFY id int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table customer_devices
ALTER TABLE customer_devices
MODIFY id int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table devices
ALTER TABLE devices
MODIFY id int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table services
ALTER TABLE services
MODIFY id int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table settings
ALTER TABLE settings
MODIFY id int(11) NOT NULL AUTO_INCREMENT;
--
-- Constraints for dumped tables
--
-- Constraints for table customer_devices
ALTER TABLE customer_devices
ADD CONSTRAINT customer_devices_ibfk_1 FOREIGN KEY (customer_id) REFERENCES customers (id),
ADD CONSTRAINT customer_devices_ibfk_2 FOREIGN KEY (device_id) REFERENCES devices (id);
--
-- Constraints for table services
ALTER TABLE services
ADD CONSTRAINT services_ibfk_1 FOREIGN KEY (customer_id) REFERENCES customers (id),
ADD CONSTRAINT services_ibfk_2 FOREIGN KEY (device_id) REFERENCES devices (id);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT /;
/!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS /;
/!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;