Questions tagged as 'php'

2
answers

Select specific columns of two related tables

I have a relation of N x 1, Post x User , have a relationship like the following: Post.php (model): .... public function user() { return $this->belongsTo('User'); } .... What I want is to select the id and the user...
asked by 31.10.2017 / 21:55
1
answer

Relate items in an array recursively with PHP

I would like to know if there is any native function of PHP to relate all the items of arrays with all the items of other arrays, for example: $arr['a'] = [1,2,3]; $arr['b'] = [4,5]; $arr['c'] = [7,8,9,10]; To get the following result: $r...
asked by 30.10.2017 / 19:27
1
answer

Capturing the boolean value of a checkbox in PHP

I'm making a product form, where the user needs to report whether or not the product is used, but I'm having difficulty capturing the value of this checkbox , whether it is 1 or 0 , mysql the column is already set to...
asked by 03.12.2016 / 23:12
1
answer

Creating dynamic thumbs

How to site such as Youtube, Netflix and many other sites do this function? Are the thumbs created at the time of the mousemove / mouseenter in the progress bar, or have they already been created before and the player only displays? If they are...
asked by 28.11.2016 / 23:45
1
answer

JSON with value - App List Null

I'm creating an App, where it will display some information from an external database using a JSON file so that I can display this information in the App. But when I run the code, the list in my app returns null and void. I would like to know wh...
asked by 03.12.2016 / 20:34
2
answers

php query filter mysql

BD Structure Companies ----------------------------------- | uid | nome | endereco | | 1 | empresa01 | endereço01 | | 2 | empresa02 | endereço02 | ----------------------------------- Products -----------------...
asked by 15.11.2016 / 14:39
1
answer

Is it possible to override the with method of Laravel?

In parts of my application I'm using the following redirect : return redirect('/painel/posts') ->with(['error' => 'Ocorreu um erro ao tentar adicionar o post!']); Could it be in App\Http\Controllers\Controller.php...
asked by 10.11.2016 / 13:29
1
answer

ODBC PHP / Oracle - UPDATE, INSERT, DELETE

I'm in a project using PHP and Oracle. the connection is OK, with this code I can execute all the selects I normally need, which I can not execute are INSERTS , UPDATES and DELETE . Could anyone tell me why? <?php requ...
asked by 20.12.2016 / 17:19
2
answers

How to switch table colors by grouping by a specific table field?

I have the following code. <table style="width:100%;"> <thead> <tr> <th scope='col'>&nbsp;&nbsp;Nº Comanda&nbsp;&nbsp;</th> <th scope='col'>&nbsp;&nbsp;Produ...
asked by 04.10.2017 / 13:35
1
answer

Delete select value comparing to another table

Good morning, I'm developing a scheduling website, however, I'm having a hard time trying to display only the times that are available. Explaining: There is a schedule Agendamento´, onde fica registrado o horário de inicio horainicia...
asked by 19.11.2016 / 14:45