Questions tagged as 'php'

1
answer

Notice: Trying to get property of non-object

I'm having the following error: Notice: Trying to get property 'idDia' of non-object in C:\wamp64\www\backend-trabajo-final\profesionales\select-profesionales-para-posible-servicio.php on line 26 (So, with each of the properties I try...
asked by 24.09.2018 / 13:38
1
answer

Share variables between classes in PHP

I have several classes as in the example. class clase1 extends padreclase1 { var $variable1 = 'valor1'; var $variable2 = 'valor2'; } class clase2 extends padreclase2 { var $variable1 = 'valor1'; var $variable2 = 'valor2'; } The val...
asked by 19.09.2018 / 06:39
3
answers

Count logs with foreach PHP

Well it's quite simple I suppose, but the point is that I want to count the records in the database, in this case I have 2 in the DB, and when I put the foreach and see it in the table it shows me the 2 records but with the number 2, when...
asked by 21.08.2018 / 21:10
2
answers

Find duplicate records, change them and return them only in MySQL

I have a problem, I have data from a table that is duplicated, inside are the following fields id, empresa, actividad, compañia I need the field empresa is unique, I generate a query to know how many and which are duplicates and I...
asked by 28.09.2018 / 14:59
1
answer

Class shows values that do not correspond to the select

I'm using PHP / MySQL and in a class I have a function that should look for two maximum values in a single line and I have this code: $sql = "SELECT max(id) as id, max(lote) as lote FROM sc_operac limit 1"; $bd = new ConexionDB(); $stmt = $bd-...
asked by 29.09.2018 / 11:56
3
answers

How can I connect to a web database from my PC?

Well this case had not been presented to me until now, it turns out that I have an acquaintance who bought a domain (from him) and separated me a space (so to speak) on his server. I have my web hosted, I'm just going to start developing what's...
asked by 22.09.2016 / 15:28
1
answer

Upload images in PHP

I am working on a database to show images. I am preliminarily occupying XAMPP. I took a code from the web but I can not make it work. I think I know where the problem is but I can not solve it. The code throws an error:    Fatal error: Cal...
asked by 26.09.2016 / 23:06
1
answer

Error could not find driver in php 7.2

PHP: <?php //incluimos nuestra conexion include_once("../Modelo/conexion_login.php"); try { //creamos nuestra conexion $dbConn = new PDO('mysqli:host=localhost; login_tm', 'root', '1998'); $dbConn-&...
asked by 25.06.2018 / 19:13
1
answer

Replace values of an Array from other Arrays in PHP

I need to perform a array that stores values according to a comparison of arrays. Let me explain: I have an ArrayA ArrayA = [1,1,0,2,0]//1 = Activo, 0= neutro, 2=desactivado and other Arrays that can be several. For example: Arr...
asked by 19.06.2018 / 22:05
2
answers

PHP - Delete values of a variable $ _POST with str_replace

Good day. I would like to delete some values of a query that I receive via POST. I have a variable $ query which receives the value = SELECT * FROM equipos WHERE () AND (( nombre='computadora' OR nombre='mouse' OR nombre='teclado' )) AND (( d...
asked by 04.07.2018 / 21:39