Questions tagged as 'mysql'

1
answer

SQL string combination

I need to generate all word combinations of a varchar of a record from a database. I need to develop in MySQL in PostgreSQL To get simpler: BASE DATA TABLE Howtomakeaprocedure/functionthatselecttherecordsanddot...
asked by 11.08.2016 / 19:25
3
answers

Join only if the above query returns records

Good people, I would like to know what approach they would take to make a union only if the above query, from the union, returns values. Consider that the tables are compatible EX: SELECT * FROM Tabela1 UNION SELECT * FROM Tabela2 /*Esta q...
asked by 02.06.2016 / 19:11
3
answers

Error performing a database query

I'm using Zend and I have the following function: public function getChamado($id) { try { $cols = array( 'id', 'titulo', 'descricao', 'fk_status', 'fk_local', 'fk_tipo', 'created', 'modified', 'finished', 'fk_usuario',...
asked by 31.01.2014 / 00:09
3
answers

Structure table day and time (calendar type)

I need to create a table that contains days and times of operation of an establishment, a sort of agenda. This table should represent every day of the week and each day contain the opening and closing times. The challenge is to create this table...
asked by 07.11.2016 / 15:37
2
answers

Pivot Tables with JQuery, JavaScript and Mysql

Good afternoon, friends, I'm having a problem, I can not register all the users in the database, just register the last one, how can I solve this problem? Index<formmethod="post" action="salvar.php">             Name       CPF     ...
asked by 14.12.2016 / 20:29
2
answers

Table of users with same usernames

In a MySQL database table, I have a new user registry, the primary key of the table being an ID field. However, I may end up creating, even by accident, users with the same username. For example, "joao.silva" can be registered for users named...
asked by 29.11.2016 / 14:18
2
answers

Trigger in MySQL VS logic in PHP application?

I am doing stock control system, and I would like to know the advantages and disadvantages between two ways of implementation to do the subtraction of the number in the stock after a sale / exit. 1) Do a% direct update in the application t...
asked by 08.09.2016 / 15:29
1
answer

Run ECHO without interpreting HTML

I have a value in the mysql database that contains some html commands like:    <b>Olá</b>       <br>       Other ... I need to display the value using <?php echo $row_rs['original']; ?> to ap...
asked by 18.11.2015 / 18:47
4
answers

Leave last 12 records and delete the rest in PHP / MySQL

I would like to make sure that after the script runs, there may only be the last 12 records in a specific table that has the date field in international format if you can assist. <?php # Este pequeno script PHP recupera o OD do imóvel visi...
asked by 29.09.2014 / 18:14
4
answers

Query DB and show all results except first

I have the tbl_galeria table, what happens is that I want to make a query, but the query can not show the first result. That is, the query will return all values except the one with the smaller id. $query = mysql_query("SELECT * FROM tb...
asked by 02.07.2014 / 15:23