Questions tagged as 'php'

2
answers

Multitasking queries in MySQL

I am doing a query with MySQL where I have some establishments and in another table I have the comments of the establishment. This is the query I do: SELECT * FROM establecimientos INNER JOIN comentarios ON establecimientos.id = comentarios...
asked by 02.04.2018 / 06:28
3
answers

Substring starting at the end

I need to separate the string, remove the blank spaces and the arrow, I just want to keep the tags, each one in a different variable. The first one if it comes out but the second one no longer. $str = 'PD/R --> PPA'; $parte_1 = substr($str,...
asked by 26.12.2016 / 19:29
2
answers

CRUD data with bootstrap and PHP [duplicated]

I have a problem with some statements that I am using for a CRUD of data with bootstrap, php and html. I have the following code in which I connect to the DB without including an external library. <?php function conectar_bd...
asked by 20.07.2018 / 20:52
2
answers

strpos always returns 0 in this rule

I do not understand the reason why the following rule returns to me in this case the value 0. The code in PHP is this: $contador = (strpos($posts[0]['Codigo_juego'],$usuario_color['siguiendo_juegos']) !== FALSE) ? 1 : 0; What results in thi...
asked by 03.03.2018 / 01:10
2
answers

Create an array in php with custom data

Hi, I'm trying to create an array to save me recursive queries to mysql. The idea is to associate the id of a record in mysql to its name and so instead of doing queries to mysql what I can do is traverse the array to show the data. In pri...
asked by 28.11.2017 / 13:36
2
answers

Recoverable fatal error: Object of class PDOStatement

Query: static public function contarAccesorios(){ $ejecucion = self::Conexion(); $sql = "SELECT count(idaccesorio) FROM accesorios;"; $registro = $ejecucion->query($sql); return $registro; } Why...
asked by 12.12.2017 / 12:38
1
answer

Script php, insert data in mysql

I have this PHP script where I make an insert query in a mysql DB, what I do is declare a mysqli object globally and then from a function make the insert, but since the insert function gives me an error, it tells me that recognizes the $ mysqli...
asked by 16.05.2018 / 17:58
2
answers

Fatal error: Call to undefined function sqlsrv_connect ()

I think many of you have seen the following error:    Fatal error: Call to undefined function sqlsrv_connect () I have done everything, change versions read many forums and then nothing. I have the following extensions enabled in php.i...
asked by 16.03.2017 / 00:48
1
answer

Class to load scripts and css in PHP [closed]

I need a method to load css and javascript files dynamically on each page, so as not to load unnecessary files and improve performance. Create a class in php that works, but I want to know if there is a better method. I do not use any PHP framew...
asked by 12.02.2017 / 21:40
2
answers

Problem with variable when going through jQuery

Good day I have the following problem: I make a query with a patient that is in the database, but I get that it does not exist in this. I'm using jQuery I use a function that directs to another page and passes a variable 'document' to be p...
asked by 27.11.2018 / 17:12