Questions tagged as 'mysql'

1
answer

List of Students in PHP and MySQL

I am developing a student registration system, they have a career, semester, period. These attributes are stored in the student table as an id, race_id, semester_id, period_id, and represent a data from another table, since I have selections loa...
asked by 26.05.2016 / 04:42
2
answers

How do I sum up the total of several grades?

In my DB I did the search of a student and threw me the subjects that he / she has studied (24 subjects), qualification of each subject and the credits of each one (1 subject = 10 credits). Now, what I want is to add the credits and that they no...
asked by 17.05.2016 / 02:32
2
answers

Update several records of a column in a single SQL query

I want to reduce the number of UPDATEs that I make from my application to the table ventas of my database. This UPDATE sends a value to the record in the ordenadores column, as long as it matches the values passed to id and...
asked by 16.05.2016 / 21:13
1
answer

Show query mysql results horizontally

I have a table called "revisions" in mysql, which has its id field, product_id, date (datetime). This table has only one record per month and I need you to throw the result of the query to the side instead of rows down, that is: select * fro...
asked by 27.03.2017 / 21:34
2
answers

Count occurrences followed by a value in a table

Hello, I have a table that has a value ID and other values among which is nombre . ############### # ID # Nombre # ############### # 4 # Juan # ############### # 3 # Juan # ############### # 2 # Juan # ############### # 1...
asked by 17.03.2017 / 05:51
1
answer

Avoid duplicate records and account for them

I have a query in which I get a list of companies SELECT S.FileB64 AS ImgB64, E.* FROM dbempresas E LEFT JOIN systorage S ON S.id = E.Logo_100 ORDER BY E.Nombre; RESULTADO: id | RFC | Nombre ---+--------------+----...
asked by 14.03.2017 / 17:11
1
answer

Modify database after publishing post wordpress

I am working with Custom Post Type, creating classes and courses. When the course is scheduled as a draft it does not let me select it as the parent of the classes. How can I do an UPDATE to specify the father at the ID level? That is, by...
asked by 26.12.2018 / 16:01
1
answer

Query if inside a trigger

If I update a person with a vacuum that does not insert anything in Audit, but if I update a person with a data, name, etc., that does a INSERT . I have a reservation table with schedules, when someone booking updated the person field asso...
asked by 29.01.2016 / 20:18
1
answer

fetchColumn vs. columnCount

colsulta SELECT that a single record should return if it exists, what's valid with if ($stmtStore->fetchColumn ()==0){...} and the redultado is true and the valid one with if ($stmtStore->columnCount ()=...
asked by 01.12.2018 / 02:04
1
answer

Insert in two tables at once

I have the general table I also have the table line And finally I have the company_line table What I want to do is that when I insert in the general table the general_id of the new record is passed to the company_line...
asked by 29.11.2018 / 21:59