Questions tagged as 'mysql'

1
answer

Query SQL query

I need to make a MySQL query in the following situation: I have two ads and likes tables; when a user likes an ad, a record is created in the likes table with the user id and ad id Enjoyed it. You need to capture the most tanned ads. S...
asked by 13.01.2016 / 19:17
1
answer

Querys MYSQL PERTENCE

I need to make a query in mysql , within the WHERE I need that is containing COD_IDENT within a group. That is: COD_IDENT 5 6 7 My query must return all results where COD_IDENT is equal to 5,6,7...
asked by 05.02.2016 / 18:32
2
answers

What is the risk of this injection? [duplicate]

Personally, what risk would I run if someone wanted to give an injection in this example: $valorGet = $_GET["valor"]; $sql = "SELECT * FROM tabela WHERE caminho = '$valorGet'"; My question is, can the guy delete (DELETE) or insert (INSERT...
asked by 02.09.2015 / 20:45
2
answers

Using "anti_injection" in an MD5 password

I am studying a bit more in depth PHP and in security issue in PHP I have used the standard anti_injection found on the internet outside and used by many function anti_injection($sql){ $sql = preg_replace(sql_regcase("/(from|select|insert|dele...
asked by 01.04.2016 / 06:46
1
answer

Checkbox loaded from the bank

I have a difficulty executing a logic, I have a table in the database that saves the values of an array, takes the values of one or more selected checkboxes and saves with # separating the numbers. Ex: 0 # 1 # 2 # 3 # 4 # 5 # 6 #. I want to retu...
asked by 30.08.2018 / 18:57
2
answers

Column INT only accepting positive values

How to set table in MySQL so that certain column INT accept only positive values?     
asked by 13.08.2018 / 02:57
1
answer

Warning illegal string offset

I created a class with arrays to be populated with objects, I made the select from the database, then I made a foreach to create a new object with each row of the select return and save those objects in the array. > But when I try to cr...
asked by 16.06.2018 / 22:48
1
answer

How to work in the same database by workbench and terminal? [closed]

I created a database through the workbench ButIcannotfinditfromtheMacterminal.HowdoIworkonthesamedatabase?Howtofindthedatabasecreatedbytheworkbench?Andviceversa...I'mconnectingthroughthecommandmysql-hlocalhost-uroot-pthroughtheterminal.  ...
asked by 13.03.2018 / 22:19
1
answer

List and Count Rows of a Table in MySQL

I'm trying to make a listing of users who logged in and at the same time a count of how many times each user logged, from logins records in a table, I do not know how to explain very well, MySQL table (logins): Nome | Hora_de_Login ---------...
asked by 01.03.2018 / 21:24
1
answer

My code does not error, but does not compile either. Nothing happens: / [closed]

I do not know what happens in the code. It does not error, but also does not insert and does not go to the Login screen and also does not enter the else "error"     
asked by 21.05.2018 / 04:31