Questions tagged as 'mysql'

1
answer

Microsoft SQL Server for MySQL

I need some help. I downloaded a project in C # from inventory control, however the database is by Microsoft SQL Server, and I would use MySQL to connect and record data. Here is an example of connection files: Archive: DAL > using...
asked by 15.06.2016 / 00:44
1
answer

How to check if a table exists in MySQL

I already found several forms on the internet, but none of them the way I wanted it. I would like a java method to check whether or not a table exists in the database, if it exists, return TRUE or return FALSE . Thank you in a...
asked by 28.05.2016 / 04:24
2
answers

Error adding elements in MySQL database with PDO

I'm having the following error while inserting into the database:    Parse error: syntax error, unexpected '{', expecting '(' in /var/www/public/Test/db/add-banco.php on line 18 Line 18 is: } catch { <?php $host = "localhost"...
asked by 31.05.2016 / 15:21
1
answer

Database modeling, many-to-many relationship between two tables [closed]

I have 3 websites that will share the same database. There are 3 tables: News, Photo Gallery, Blog. It will only be a management system for the 3 websites. Example: The user will save news that belonged only to 2 websites. Question: What i...
asked by 26.05.2016 / 13:43
1
answer

Select to bring specific record of an id

I would like to know how to get a specific record of a fk, I have the hosting table and the consumption (with codHospedagem ). When I select some hosting, I click on the consumption button of my consumption screen. I need to bring i...
asked by 19.05.2016 / 23:27
2
answers

UPDATE in MySql based on the last date of a column

I am trying to update a table in MySql (Client table status field) based on the last date that this client was visited (field dateTable of the Schedule table), passing as a parameter the number of days that will define the change of the status o...
asked by 17.10.2016 / 21:55
2
answers

Inform a date, and pick up the interval of the week of the month of that date (from Sunday to Saturday)

I need a SQL command (SQLite for android) that returns the one-week interval (from Sunday to Saturday) of an informed date. For example: I enter the date '05 -05-2016 ', hence the command in sql would return the range '01 -05-2016' and '07 -05-2...
asked by 05.05.2016 / 17:24
1
answer

Query with date in variable in MySQL returning empty

I need to make a query in MySQL setting 3 variables, when I know in the case of integer number of the right one, more when I include data ta returning empty. Follow my query , what could be doing wrong? SET @tipo = 47; SET @dataini = 201...
asked by 04.05.2016 / 21:35
1
answer

Index in an ENUM field can bring some advantage?

I was reading in a response from SOEN that fields in a table that have INDEX can optimize a query. Of course, as long as this query is known, such as a user search for the email field, for example. I have here a Person table t...
asked by 02.05.2016 / 13:53
1
answer

Select between 2 tables

Based on the tables below and passing the 'start date' and 'dataFim', would it be possible with only one Select select from the Vehicle Table only vehicles that are not in the Reserve Table? I'm studying Inner Join, but I have no idea if this is...
asked by 17.05.2016 / 05:33