|
|
@@ -40,7 +40,7 @@ export const confirmUser = async (username) => {
|
|
|
|
console.log(tableName);
|
|
|
|
console.log(tableName);
|
|
|
|
|
|
|
|
|
|
|
|
const [createTable] = await pool.query(
|
|
|
|
const [createTable] = await pool.query(
|
|
|
|
`CREATE TABLE IF NOT EXISTS ? (
|
|
|
|
`CREATE TABLE IF NOT EXISTS ?? (
|
|
|
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
|
|
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
|
|
|
Vorname VARCHAR(100) NOT NULL,
|
|
|
|
Vorname VARCHAR(100) NOT NULL,
|
|
|
|
Nachname Varchar(100) NOT NULL,
|
|
|
|
Nachname Varchar(100) NOT NULL,
|
|
|
@@ -64,7 +64,7 @@ export const confirmUser = async (username) => {
|
|
|
|
let nextID;
|
|
|
|
let nextID;
|
|
|
|
const getNextID = async () => {
|
|
|
|
const getNextID = async () => {
|
|
|
|
const [rows] = await pool.query(
|
|
|
|
const [rows] = await pool.query(
|
|
|
|
`SELECT id FROM ? ORDER BY id DESC LIMIT 1`,
|
|
|
|
`SELECT id FROM ?? ORDER BY id DESC LIMIT 1`,
|
|
|
|
[tableName],
|
|
|
|
[tableName],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
nextID = rows.length > 0 ? rows[0].id + 1 : 1;
|
|
|
|
nextID = rows.length > 0 ? rows[0].id + 1 : 1;
|
|
|
@@ -89,7 +89,7 @@ export const newEntry = async (formData, username) => {
|
|
|
|
const tableName = confirmation.tableName;
|
|
|
|
const tableName = confirmation.tableName;
|
|
|
|
|
|
|
|
|
|
|
|
const [result] = await pool.query(
|
|
|
|
const [result] = await pool.query(
|
|
|
|
`INSERT INTO ? (Vorname, Nachname, EMail, Telefonnummer, Lose, Firmenname, Vorname_Geschaeftlich, Nachname_Geschaeftlich, EMail_Geschaeftlich, Telefonnummer_Geschaeftlich, Strasse_Hausnr, Plz_Ort, Zahlungsmethode) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
|
|
`INSERT INTO ?? (Vorname, Nachname, EMail, Telefonnummer, Lose, Firmenname, Vorname_Geschaeftlich, Nachname_Geschaeftlich, EMail_Geschaeftlich, Telefonnummer_Geschaeftlich, Strasse_Hausnr, Plz_Ort, Zahlungsmethode) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
|
|
[
|
|
|
|
[
|
|
|
|
tableName,
|
|
|
|
tableName,
|
|
|
|
formData.firstName,
|
|
|
|
formData.firstName,
|
|
|
|