Click here to Skip to main content
15,867,942 members
Everything / Database Development / MariaDB

MariaDB

MariaDB

Great Reads

by Member 4206974
A PHP class that uses PDO for creating a table from JSON Objects

Latest Articles

by Member 4206974
A PHP class that uses PDO for creating a table from JSON Objects

All Articles

Sort by Score

MariaDB 

22 Jun 2020 by Patrice T
Quote: Can't find syntax error anywhere in code Syntax error is in SQL command I would start with: SQL = "INSERT INTO Employee (Email, First_name, Last_name, Phone, Admin, Active)" ' ...
23 Jun 2020 by MadMyche
As Patrice and 0x01AA have pointed out, you should watch for spaces and other separators. Your statement does not have a space between the parentheses VALUES, and then an empty value at the end of the statement INSERT... , Active)VALUES(... '" +...
23 Jun 2020 by Patrice T
SQL = "INSERT INTO Employee (Email, First_name, Last_name, Phone, Admin, Active)" SQL += "VALUES ('" + email + "','" + first_name + "','" + last_name + "','" + phone + "','" + admin + "','" + active + "');" Not necessary a solution to your...
18 May 2022 by Chris Copeland
I would typically be surprised to see hard-drives fail so quickly within such a short period of time, some hard-drives can support millions of writes before it becomes an issue, maybe less so with SSDs which can only sometimes support several...
21 Jul 2022 by Richard MacCutchan
Try removing the quotes from the table and column names: $insert_query="insert into categories (category_title) values ('$category_title')"; See A MariaDB Primer - MariaDB Knowledge Base[^]
21 Jul 2022 by Chris Copeland
Before someone posts the obligatory comment about not using string interpolation for running SQL queries, the issue here is simply that table and column names are not meant to be surrounded by single quotes ('). You can either omit the quotations...
31 Dec 2019 by Oviya Sivakumar
want to display that which department have least number of employee ? and department with 2nd least number? there are three tables 1)departments *dept_no *dept_name 2)dept_emp *emp_no *dept_no 3)employees *emp_no *emp_name how to join these tables and find which...
31 Dec 2019 by OriginalGriff
Well ... "de" doesn't exist: (select min(count(de.emp_no)) And GROUP BY needs to precede HAVING: having count(dt.emp_no)= ... group by d.dept_name; But why so complicated? A simple JOIN will do it: SELECT TOP 2 d.DeptNo, d.DeptName, de.EmpPerDept FROM Departments d JOIN ( SELECT DeptNo,...
21 Jun 2020 by MarissaReloaded
I have two tables, and I would like to update the running balance of expenses by retrieving the allocation(budget) based on matching voteid I'm using phpmyadmin mysql * Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.4.6 * Database client version:...
20 Jun 2020 by Herman<T>.Instance
The part of the query SET @csum = (SELECT allocation FROM vote INNER JOIN expenditure ON vote.voteid = expenditure.voteid GROUP BY vote.voteid); will return mpre than 1 rows. You have to refine that...
21 Jun 2020 by Jörgen Andersson
You are thinking procedurally. With SQL it's best to think in sets. And you should also consider keeping the data normalized, so the need to update the balance is a bad idea, that should be queried when needed. Database normalization -...
22 Jun 2020 by Member 14870365
#! /usr/bin/env python3 print('Content-type: text/html\n') import MySQLdb, cgi def results_table(records): html = """
22 Jun 2020 by Maciej Los
Not an answer, but suggestion. I'd suggest to use PyPika · PyPI[^]. Why? Quote: The motivation behind PyPika is to provide a simple interface for building SQL queries without limiting the flexibility of handwritten SQL. Designed with data...
4 Feb 2021 by Member 15064692
I have a stored procedure that i call with a JSON object of paired values. I can't get it to output to a table what am i doing wrong? The table should output as a table with two columns, key and value. An example input would be CALL...
4 Feb 2021 by Richard Deeming
Using the Jayway JsonPath evaluator[^], it seems that $.`key` will not match anything in your input document. From a quick read of the JSONPath syntax[^], it seems that this is looking for a property called key on your JSON object. There is no...
14 Feb 2021 by JamesV7
Example Input Table: Unit Name Phone Address Email 200 Joe Bloggs 555-1234 15 Sea Lane owner1@example.com 200 Jane Bloggs 555-1235 15 Sea Lane owner2@example.com 201 Peter Parker 555-1236 12 James...
14 Feb 2021 by k5054
Have you tried using SELECT DISTINCT? See here: Eliminating Duplicates from a Self-Join Result | Handling Duplicates[^]
24 Apr 2021 by OriginalGriff
Not like that! There are two big problems here: 1) Never concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Always use Parameterized...
18 May 2022 by Chopin2001
This is a feed parser prototype that I personally made in PHP. As you can see, it's a mess. No one is going to make it this way. :( It uses a mysql database and links in tables store unique webpage links to documents. If this link doesn't exist,...
1 Nov 2022 by Graeme_Grant
Did a quick google and there is a lot of information & tutorials on how to do this: php mariadb encrypted - Google Search[^] & php mariadb encrypted tutorial - Google Search[^] * Encrypt a MariaDB database table[^] * BEST PHP ENCRYPTION...
31 Mar 2023 by Member 4206974
A PHP class that uses PDO for creating a table from JSON Objects
23 Jun 2020 by Member 14870365
HTML Employee Add Employee Table Email:
24 Apr 2021 by mael_baslote
What I want is when a new teacher is added, it will create a table in the database with the name $param_subject1. It does create the table but I also want to insert the information of the new teacher in that created table. try{ ...
11 Apr 2022 by Lê Huy Tú
Hi! Today I edited the theme causing the website to have some errors, I reinstalled a whole VPS server with Cyberpanel. I had the file backed up from yesterday and Then I started to upload the SQL file through PhpAdmin but I am getting this...
21 Jul 2022 by vijaya kumar 2022
Fatal error: Uncaught mysqli_sql_exception: 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 ''categories' ('category_title') values ('Beauty Sleep')' at line...
1 Nov 2022 by Tony Starke
Hello members of the programming technorati. I come to you with an issue that I cannot seem to solve. I am trying to insert encrypted data into a mariadb table with no success. here is the code: $insert_sql= "insert into loan_tbl set clientID =...