Questions tagged as 'mysql'

1
answer

Count the number of unique data in a table

I have a table in a database that holds the name of each user who accessed my application in PHP. I would like to do a function that calculates the number of unique users who have accessed it so far (assuming a user can access it more than once)...
asked by 05.09.2015 / 15:36
1
answer

Problem with Database Connection

Could you help me figure out why you're giving this error? Code: using (_connection = new MySqlConnection("Database=test;Data Source=localhost;User Id=root;Password=teste;SslMode=None;")) { _connection.Open(); var cmd = new MySqlCom...
asked by 09.03.2017 / 12:11
1
answer

List data only for a given ID

I made a small system where the administrator "sends" documents to a certain user, where he sends the info to a DB and generates a folder with the user ID. In the image below is the BD responsible for recording the information of the files sent,...
asked by 07.03.2016 / 01:55
1
answer

if within mysql show to create or insert [closed]

Good afternoon, I need to understand how an if inside mysql works so I can use it as follows. I have a foreach which only executes after a select database because it leaves an array for this foreach, in this foreach it will run a condition, i...
asked by 20.03.2016 / 22:03
1
answer

Display only landline and cell phones with digit 9 in front

Next I have a table named telefonia_numero and inside it there is a field called Numero where it contains all the user's phone.    Ex. Jose - Number 81 3636-1145, 81 99873-7787 and 9873-7787, Here comes what I want. I...
asked by 21.03.2016 / 19:46
2
answers

Recording of rows in txt file in c # windowsform

I'm doing a program that queries some Mysql tables and generates a list to which populo in a gridview. After that, I did a C # routine that reads each line and writes to the txt file in c: \ text.txt. So far so good, the problem is that when rec...
asked by 26.02.2016 / 20:42
2
answers

How to merge edit / new button?

I would like that, if already there is $nome registered in the table, it gives an update and if it does not exist, it gives an insert. I do not understand what the problem is in my code. $dbconn = mysqli_connect($servername, $username,...
asked by 01.07.2017 / 13:24
1
answer

Sql calculates date instead of insert

I'm trying to insert date into my DB but sql calculates the result always is 1997 in the fields I tested as "date" and did not insert "varchar and text" resulted me a calculation of subtraction of the current date      $conn = new PDO('mysql:h...
asked by 13.07.2017 / 02:40
1
answer

How to count the number of rows in an SQL statement?

I'm in this SQL, retrieving records (number of providers per city) from a table and would like to count how many records it has in each city . I want in front of the cities, put something like Tal (9) . I will put a print of the result of this...
asked by 24.10.2016 / 18:17
2
answers

Query MySQL generating error when using the OR clause

I have the query used in WP and it causes an error when I use OR, it follows the usage example: SELECT * FROM ' . $table_ucf . ' WHERE form LIKE "'. $this->form_active.'" AND name LIKE "%s" OR email LIKE "%s" If I take the condition afte...
asked by 25.10.2016 / 13:45