Questions tagged as 'mysql'

1
answer

How to create a set of tables in the database via PHP

I'm having trouble while creating the database automatically via PHP. I am developing a project in MVC from college and wanted to import the sql file and through a query create the tables. In the previous part of the code is made the connecti...
asked by 25.11.2014 / 12:21
2
answers

Format String to insert in Mysql (TIMESTAMP)

I need to insert a string which looks like this: "2014-11-25T14:13:35.000Z" in a MySql database and using PHP in a TIMESTAMP field. How can I format the string for insertion using PHP?     
asked by 25.11.2014 / 18:56
1
answer

MySQL query result different localhost and output

I have a problem in which the same query executed on the local server and production returns a different result. The production version is coming incomplete in the AVALIACOES field. I checked the mysql version of the server and local and they ar...
asked by 21.11.2014 / 18:42
1
answer

How to delete all records from a belongsToMany

In laravel, when we have a many-to-many relationship, we have a method called attach and detach The attach adds entry in a n:n relationship, and detach removes them. In both cases, these operations are performe...
asked by 09.02.2015 / 14:24
1
answer

Problem in Url Friendly

I'm here with another problem regarding this line RewriteRule ^([a-zA-Z-0-9-_]+)$ index.php?controller=estabelecimentos&option=tipo&tipo=$1 [L] Hardware htaccess RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_F...
asked by 11.02.2015 / 17:33
1
answer

Error trying to join 3 tables

I'm trying to join three tables from my database, being Propriedades | Licitacoes | Usuarios . Only every time the same mistake is made! it is: Fatal error: Call to a member function fetchAll() on a non-object in *** on line 61 The pu...
asked by 11.02.2015 / 20:10
2
answers

Search between two dates in my database

I wanted to know if you could help me solve a problem that I'm having trouble solving. The problem is this: I have a database with a table of values that I keep: date : dateTime value : int equipment : int (foreign key that comes f...
asked by 19.11.2014 / 12:54
1
answer

How to create a system to list the most popular images in my application

I want to put together a system to display the most popular images in my application. Today I've ready these images in a simple but efficient way: the folders become categories and ready the images from inside the folder. Then the application re...
asked by 30.01.2015 / 11:43
1
answer

Format result with concatenated field

I need to bring a TIMEDIFF with a formatted field like this: 12:50 (hours and minutes) from my database. I use the following excerpt: CONCAT(HOUR(TIMEDIFF(Campo.expired,NOW())),":",MINUTE(TIMEDIFF(Campo.expired,NOW()))) AS expired My proble...
asked by 27.01.2015 / 15:26
1
answer

Doubt of Concept when registering parcels in the database

Personal if I have a sale to be registered, with contract number, customer data and among others and I have fields of sale with parcels ... Al that comes my doubt, I must create a plot of plots interconnected by the number of the sale and each r...
asked by 04.11.2014 / 20:07