Questions tagged as 'mysql'

1
answer

Script php, insert data in mysql

I have this PHP script where I make an insert query in a mysql DB, what I do is declare a mysqli object globally and then from a function make the insert, but since the insert function gives me an error, it tells me that recognizes the $ mysqli...
asked by 16.05.2018 / 17:58
4
answers

Java syntax error

Good morning, I have the following code but it does not run after creating the table in the database. I imagine it will be a syntax error in INSERT or in UPDATE : public class Conectate { private String driver ="com.mysql.jdbc....
asked by 25.02.2017 / 19:12
1
answer

Difference between count (*) and count (column-name)

When I was practicing SQL queries, I had a question with the way of doing one. I would like to know what is the difference between:    SELECT open_date, COUNT (*) FROM accounts with this other    SELECT COUNT (open_date) FROM accounts...
asked by 03.02.2018 / 15:53
2
answers

Login with Ajax, PHP and MySQL [closed]

I have a question, I am starting to work with Ajax and PHP and I want to know how I can login with Ajax to validate the user if it is registered or not, my users have them in a MySQL database but I do not know how to do that validation.     
asked by 03.02.2018 / 07:28
3
answers

Error inserting a datetime with PDO

I am changing the entire system from Mysqli to PDO and I am having a problem when trying to insert a date in a field of a record. The record that I try to record is news, which involves a date. The format of the date that I bring w...
asked by 27.07.2017 / 02:14
1
answer

Error - # 1046 - Database not selected

I'm trying to upload a database of a BackUp that I made from a page, but I get the following error: Error consulta SQL: CREATE TABLE IF NOT EXISTS 'wp_commentmeta' ( 'meta_id' bigint(20) unsigned NOT NULL AUTO_INCREMENT, 'comment_id' b...
asked by 08.06.2017 / 20:00
1
answer

can a primary key be modified in mysql?

I have a query about mysql, I currently have two user tables where my main key is dni and in session. id and I have a form from php in which I update the data of a person .. my query is as follows: Can I update the data of my main user ke...
asked by 21.07.2017 / 03:35
3
answers

Count records per month in a MySQL table

I have a table in MySQL and would like to make the following query: I need to know how many records I have according to the date. The field fecha I have it in the following format 2016-07-12 . How can I know the number of records...
asked by 05.01.2017 / 17:52
2
answers

How can I join these two SQL queries?

I need to join this query SELECT CodContrato, FechaBaja, FechaFin FROM Contrato WHERE ( (FechaBaja != FechaFin) OR (FechaBaja != **SEGUNDA CONSULTA** AND (FechaBaja BETWEEN '20180101 00:00:00' AND '20181231 23:59:59') with th...
asked by 11.12.2018 / 12:38
2
answers

Error adding columns to MySql table

What could be wrong here? adding tables in MySQL (Simple query) ALTER TABLE 'shaiyar1_almacen'.'sr_productos' ADD 'item_ali' varchar(255), 'item_cat' int(11), 'item_pack' int(11); This is the error that returns me: [Err] 1064 - You ha...
asked by 13.12.2018 / 22:31