Questions tagged as 'mysql'

1
answer

Test a condition before doing UPDATE, with PHP - MySQL

I'm trying the following: I need the code below to first check that the record that is trying to be finalized (Skip status 1 to 2) is no longer finalized. If you do not follow the NORMAL UPDATE. But what happens is that when I try to finalize a...
asked by 16.10.2015 / 14:18
4
answers

Delete only selected PHP checkboxes

I have a system that I did (I do not understand much of PHP) worked perfectly but after switching the server stopped the function of deleting only the selected checkboxes, it simply deletes everything. I search all of them for database and co...
asked by 16.10.2015 / 22:40
1
answer

Recover Date of type Date - php + mysql

Hello, I'm looking for a date information from a database with a lot of information, I'm doing this: $data = $tbdeliberacoes->getData(); date("d/m/Y", strtotime($data)); And this is my return on screen: 31/12/1969 For all fields...
asked by 10.08.2015 / 14:23
2
answers

Add or show quantity of items

What is the best way to add or display the number of items in a mysql table using php. Because when I run this code the following error appears:% Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in H:\Web\root\in...
asked by 20.08.2015 / 23:36
1
answer

Can union (mySQL) also be used in Updates?

Example: $query = "update tabela set coluna1 = 1 where id = {$id_m} union update tabela set coluna2 = 1 where id = {$id_v}";     
asked by 22.08.2015 / 19:13
1
answer

Foreign key registry query with multiple occurrences

I'm developing a system for storing documentation for day-to-day use with PHP and mysql, and to make it easier to query, I have added tags to these documentation and to ensure the integrity of the data I added another table called documentacao_t...
asked by 01.10.2015 / 21:13
1
answer

IF conditional within SQL query

I have the following query: $string = " SELECT DISTINCT(idClientes), nome FROM clientes WHERE idClientes IN ( SELECT idClientes FROM planosclientes WHERE idPlanosClientes IN ( SELECT distinct(idPlanoClientes) FROM pagamentos WHERE mesRefe...
asked by 30.09.2015 / 18:08
1
answer

Error in PHP: "Fatal error: Call to a member function prepare ()"

When I try to run the SELECT on the server it accuses this msg: Fatal error: Call to a member function prepare() on a non-object in blog.php on line 97 the line referred to is this: $readPost = $db->prepare($postagemRead);...
asked by 10.07.2015 / 20:46
1
answer

Deletion with Referential Integrity MYSQL

The project world is as follows: I have a client, where I register for it, messages, news, upload photos, where there are calendars as well. So when I'm about to delete it, I need to delete everything from it, because the database does not al...
asked by 14.07.2015 / 13:17
1
answer

Problems with accents with PHP and MySQL

I'm doing a PHP form, in which I used a javascript in a combo. So when I select the first select , the second opens different data depending on what you select first. Until then, it works. Example of two different options, which I us...
asked by 13.07.2015 / 22:30