Questions tagged as 'php'

1
answer

Check if Input :: file exists Laravel

I have a class created by me that uploads files. I would like to check if Input :: file ('image') exists, because if it does not exist, it does not upload the image. Follow my code: if(Input::has('name')){ $file = Input::file('imagem');...
asked by 13.05.2015 / 22:02
2
answers

Navigate query records with PHP PDO

I have always worked with ASP connections using ADODB and navigating the logs that the query returned to me was not a problem since they were: <% rs.movenext //anda para proxima linha do retorno da query rs.moveprevious //anda para linha an...
asked by 16.04.2015 / 15:21
2
answers

number of days of the week per month

I need to check the number of the week and count how many days each week of the month has. With this code, I know the number of the week in the month (not the week of the year): function weekOfMonth($date) { // estract date parts li...
asked by 12.09.2017 / 20:50
2
answers

Place data from a row in columns

SELECT datacc, horacc FROM R070ACC WITH (NOLOCK) WHERE numcad = '2676' AND DATACC between ('2018-16-04') and ('2018-15-05') and oriacc = 'E' In the first column appears the day of the month repeated 4x, with different records in the sec...
asked by 16.06.2018 / 17:27
1
answer

Save compressed file to another directory

I have this function that does .zip of the current folder to save. But I want it to be saved in the backup folder. $data = date("d_m_y"); $exten = "_backup.zip"; // Nome final com extensão class Zipper extends ZipArchive {...
asked by 21.11.2014 / 14:21
1
answer

Is it possible to execute a query (insert) and only then check if it is duplicate?

I am reading an XML file and at the same time I insert the records into the DB. My code looks like this: foreach($itens as $item) { ... if ( ! $stmt_insert_item->execute ( ) ) { if ( $this->mysqli->errno == ER_DUP_...
asked by 06.06.2014 / 16:04
1
answer

Consultation in a relationship Many to Many in Laravel 4

Well, I'm "stuck" on a problem with a client report. I have the following relationship: Module (id, name) Associate (id, name, upper_id) Associates_Modules (modulo_id, associated_id, class, enrolled, attending, dropping) What I nee...
asked by 17.08.2014 / 00:38
1
answer

Query in mysql with hierarchy

I have a table called 'departments' with the following structure: CREATE TABLE 'departments' ( 'id' tinyint(255) NOT NULL AUTO_INCREMENT, 'company_id' tinyint(255) NOT NULL, 'name' varchar(255) NOT NULL, 'parent_id' bigint(20) DEFAULT...
asked by 08.07.2014 / 16:20
1
answer

Problem loading ajax with Cakephp 2.x

My page loads are done via ajax and loaded into the div content. Where do I get the url through the onclick event of the link, and then do the loading. Calls made directly through the menu work normally, but when I try to get the onclick event i...
asked by 12.03.2014 / 16:24
1
answer

Image limit per line using FlexBox

I'm using flexbox to display images, however it lists all in one line, I'd like to be able to display 3 images per line. HTML structure: <section class="content"> <?php $i=0; $sql = mysql_query("SELECT * FROM slideshows...
asked by 25.02.2014 / 21:23