Questions tagged as 'php'

2
answers

How to know if a file has data in php?

I would like to know what is the correct way to know when a file has information inside it. Current code: $myfile = fopen("app/vista/html5/encabezado/encabezado.html", "r") or die("Unable to open file!"); if ($myfile == false) { echo "No...
asked by 27.03.2018 / 18:02
3
answers

Error with PHP and MySQL

I have this connection <?php # Conexion con la Base de Datos $userdb = 'administrador'; $passworddb = '1234567'; $dbhost= 'dbserver'; $dbname = 'sk_modular'; ?> and I have I'm calling the database to bring me some data...
asked by 11.04.2017 / 01:09
3
answers

use the trim () function within an array

It happens that I have a select where the options are generated from a query to a database. Sometimes there are repeated options because at the beginning or at the end of each option you have blank spaces. I have the following code where I try t...
asked by 19.04.2018 / 15:51
4
answers

405 (Method Not Allowed) In Search ajax laravel

I'm trying to do a search with AJAX and it says 405 (Method Not Allowed) . I do not know what I can be, I tried looking at the routes and I can not find the error. My AJAX <script type ="text/javascript"> $(document).read...
asked by 24.01.2018 / 08:59
2
answers

It does not show all the data of the mysql database in my table

     Hi, how are you, I come with a doubt because it does not show me the data of my mysql database in a table that believes in my html. You skip the first user, it is worth mentioning that you already check my connection, the name of the fi...
asked by 18.09.2018 / 23:22
2
answers

Difference between query () and execute () [duplicate]

It really is the same: $base->query("DELETE FROM EJ_TABLA WHERE ID='$Id'"); What to do this: $base->prepare("DELETE FROM EJ_TABLA WHERE ID='$Id'")->execute(); ?     
asked by 21.08.2018 / 12:26
3
answers

determine the position of a character in a string

hello my question is how can I determine the position of the question mark in this string * and then separate it with the function substr() string = [Catálogo en línea?http://ur_prueba/index.jsp ]     
asked by 26.09.2018 / 20:31
3
answers

How to get the last character or letter of a string

I'm trying to get the last number after the last dash that is the last rallite - of a string like this Profesores-de-Barahona-demandan-calidad-del-almuerzo-escolar-y-mejorar-plantas-fsicas-3 This string comes from a URL which the...
asked by 25.11.2018 / 15:51
3
answers

Error when consulting with eloquent in laravel 5.6

I'm trying to show data from a table that is related and I'm using Laravael Eloquent for the query. but it generates the sgt error:    SQLSTATE [42S22]: Column not found: 1054 Unknown column 'a.name' in       'where clause' (SQL: select co...
asked by 26.09.2018 / 23:04
4
answers

filter with if php and show only if it is greater than 0

With this function I create the search for my earrings. function pendientesporrevisar($conexion){ $pendientes = (mysqli_query($conexion, "SELECT COUNT(*) AS conteo FROM ticket WHERE tipo_solicitud = 1 && status = 1 ")) or die(...
asked by 18.04.2018 / 15:55