Questions tagged as 'php'

1
answer

Limit number of data to be inserted in the mysql database

I insert a name from a form into a database that represents the participants of a workshop. In the workshop there is only room for 30 people and try to limit that with the COUNT (*) function. My problem is that the form keeps sending data even i...
asked by 14.05.2018 / 01:23
2
answers

Change color column date in mysql and php

I have a field in a table in my DB that is called fehca, my question is how can I make it show in my php statement change color depending on the condition of the date, for example If 14 days have passed since the date the color shown will be red...
asked by 22.05.2018 / 23:38
3
answers

Convert the Difference of two dates into an integer

I want to convert the difference between two dates into an integer, this is the code that makes the difference but it generates a string and I require an integer to use that value in arithmetic operations thanks <?php $datetime1 = date_cre...
asked by 22.05.2018 / 16:36
1
answer

Error php mysql

I have the following code tells me the errors:    mysql_query () expects parameter 2 to be resource, string given in   C: \ AppServ \ www \ tableentradaysalida \ index.php on line 35    mysql_error () expects parameter 1 to be resource,...
asked by 23.05.2018 / 00:12
1
answer

Update file field from PHP in MySQL

I have a table that stores the names of those responsible for some minutes, so once the minutes are signed I upload them so that they are included in the column of the person in charge. But when trying to upload the record, this appears:...
asked by 25.06.2018 / 17:44
2
answers

Laravel Bring data of the model grouped by months

Hello, I have the following table in the DB Fruta id | name | precio | fecha_compra I would like to bring the total price of all purchased fruits grouped by months using eloquent or querybuuilder the result that is but is the following...
asked by 27.06.2018 / 23:06
1
answer

edit values by json cake php

I have this as httpclient in cakephp I have this value in my index to be sent to edit, everything is fine here. <?php foreach ($valor->articles as $article): ?> <tr> <td><?= $article->id ?></td> <...
asked by 27.06.2018 / 23:02
1
answer

Error: Argument 1 passed to Illuminate \ Database \ Eloquent \ Model :: fill () must be of the type array

I want to update the record in a single field of the table using ajax in the following way: $('#cerrar').click(function(){ var registro=$('#cerrar').val(); var route="http://127.0.0.1:8000/almacen/compras/"+registro; var token=$("input[na...
asked by 10.05.2018 / 23:44
1
answer

Make a downgrade to PHP from 5.4 to 5.3 in Centos 6.9

We recently need to update the version of mysql and when installing the repos and proceed to the installation of mysql these repos updated me in turn the server php affecting the functionality of the system that we have runn...
asked by 10.05.2018 / 12:13
1
answer

asp.net mvc doubt with the conditional if with keys and without keys "{...}"

I have a question about what moments or parts of the code you can use a conditional if or another that can be written without the keys { ... } . For what I read this will depend on the amount of code that contains that conditiona...
asked by 09.05.2018 / 17:13