Questions tagged as 'php'

1
answer

Error building a JSON in PHP

I'm trying to build a JSOn from PHP, but when I put two conditions it does not generate the data. That is, I only need to bring the data of SARA , but when I put them in id_ppl and level at the same time, I get nothing. I do not really k...
asked by 02.08.2018 / 18:05
2
answers

Send post to the same page without reloading [closed]

You can send a post to the same php page and then I can put if isset $_POST ['data'] do something? Because what I want is that when I click, an element is added to my php array that I save in the session but I do not want to see the effec...
asked by 14.08.2018 / 16:43
3
answers

Transform php array to an array with objects?

I get the following array, all data are separated by a *, I tried to use explode and implode without results, I think something more complex is needed to solve it using php 5.6 Array ( [0] => [1] => 1 [2]...
asked by 08.08.2018 / 18:19
2
answers

Avoid changing tab with javascript

I am working with tabs on my project, the tab I build it like this: <div class="tab-container"> <ul class="nav nav-tabs nav-fill" role="tablist"> <li class="nav-item"> <a class="nav-link active" dat...
asked by 03.07.2018 / 19:18
2
answers

Why do the records in a Postgresql table keep blanks?

Quetal friends, I'm doing a practice with PHP + PDO and postgresql, and I've realized that when I save the data it leaves me blank. I attached an image and this is the code. <?php include_once "conexion.php"; try {...
asked by 30.06.2018 / 18:02
2
answers

Is it possible to traverse a JSON with for cycle? (do not use foreach)

I have a JSON that is easy to navigate with a foreach, the structure of the JSON is the following: { "llave":"valor","llave":"valor","llave":"valor" } foreach ($arrayJson as $key => $value) { echo $key . ': ' . $val; } I would like...
asked by 21.09.2018 / 21:03
1
answer

mysqli object-oriented

What I'm doing wrong I have this sql statement that should throw me 1 and is throwing me 0 my code with prepared query: <?php session_start(); include"conexion.php"; $me=$_SESSION["id"]; $id= $_GET["id"]; $sql=$conexion-&g...
asked by 25.08.2018 / 05:10
1
answer

How to select the second and the penultimate item in php?

How can I select the second and the last item in a MySQL table with php. I tried to do the following but limited myself to position 12 of 15, and must show me from position 2 to 14 of 15 in total, the second and the penultimate item. The i...
asked by 30.08.2018 / 04:05
2
answers

money_format smarty

Good, I would like to be able to convert this figure: 23785638.83 to 23.785.638,83 in smarty I was thinking about using money_format but I get it whole, if you can help me I would appreciate it     
asked by 15.12.2017 / 03:52
1
answer

Error creating a new related record

I have a table related to other PRODUCTS AND MARKS, what happens is that when I create brands and products everything is going well. The problem is when I delete a brand and create another one, and when creating a new product with a role, it sen...
asked by 28.01.2017 / 17:03