Questions tagged as 'mysql'

1
answer

Synchronize MySQL database with XLS

The situation is as follows. I have a MYSQL database and an XLS file on an FTP server The code below downloads XLS to read and UPDATE from the database from the XLS data. The problem is that it only updates the existing data, I need to check...
asked by 06.01.2018 / 00:01
0
answers

Foreign key PHP ActiveRecord

How can I delete a MySql record with PDO and PHP ActiveRecord respecting foreign keys. Example: I will delete a batch record, for example, and there is something registered in the batch I am going to delete so I wanted it not to delete and di...
asked by 04.01.2018 / 19:17
1
answer

How to remove an "item" from the last record?

I need the last record not to show <div class="staffClearFix"></div> <?php $userdata = mysql_query("SELECT * FROM users WHERE rank = '9' AND status = 'Ativo' ORDER BY id"); while($row = mysql_fetch_assoc($userdat...
asked by 04.01.2018 / 14:17
1
answer

Delete table data when it reaches a certain number

Talk about it! I have a table called tb_chat with the fields id, message, name, date, time. How do I delete data from this table when I reach '6' records?     
asked by 08.01.2018 / 16:55
2
answers

Group php mysql overdue invoices

Hello, I'm a beginner, I'm learning to do select, and I would like to receive help from this wonderful community. I need to pick up only the invoices that are with the a_vencer status of each student, it would more or less group by id the inv...
asked by 08.01.2018 / 18:27
9
answers

How to prevent SQL injection in my PHP code?

I developed a page in PHP for internal use of the company I work with and only very few people use it. You can use this page to do some queries, insertions, changes and deletions of a table in a MySQL database, however I believe that my PHP code...
asked by 03.02.2014 / 13:37
0
answers

javascript function does not assign value to variable

I have a query function to bd that returns a javascript object, but when I assign the value of this function to a variable, it returns undefined, I suspect it is because the node.js is single thread, but I do not know how to solve it. follow...
asked by 12.01.2018 / 15:25
0
answers

Change varchar data type to int

Is there any problem in changing the data type from varchar to int in mysql? I have a spreadsheet with some items that have been entered as varchar, all are numbers. The problem is that I need to do a bigger and smaller search, however, as it is...
asked by 03.01.2018 / 13:52
1
answer

Problem installing a PHP script

I have a problem to add an online chat script in my hosting, the localhost works perfectly, but by hosting no one could help me? Forthehostingisgivingthiserror:  Theapplicationcouldnotconnecttothegivendatabase.Pleasedouble  checkallofthevaluesi...
asked by 09.01.2018 / 03:04
1
answer

Unexpected result in database query

<?php class Login{ public function logar($email,$senha){ $connect=new DB; $connect=$connect->conectar(); $sql="select * from usuarios where email='$email' and senha='$senha' and status='1' limit 1;"; $bu...
asked by 26.12.2017 / 23:17