Questions tagged as 'php'

1
answer

Print data from a UNION SQL query

I have the following query to two tables with UNION . The problem is that when trying to print any data from the 2nd query it says undefine X-field , but the one from the first query does print me data. This is my code: <?php $q...
asked by 05.09.2018 / 10:19
1
answer

Problems with fetch () fetch_array ()

I'm having problems with fetch() fetch_array() I'm working with sentences prepared since yesterday I'm new to it and I have this code that practically doing fetch() is not throwing me anything I do not know what I'm doing wr...
asked by 25.08.2018 / 22:13
2
answers

Activate - disable class active of a nav-item with bootstrap 4

Greetings I would like to know if it is possible to activate the active class according to where you click, I tried with some script that I found on the web but they have not worked for me. The way I am doing it is: I have a php file where I...
asked by 24.08.2018 / 15:57
1
answer

How to correctly reference charset = utf8

I have my coding in my php code in the PDO connection, it works correctly, but when you insert the data into MySQL, you can see it; (Ñ) Send them in lowercase CASTAñEDA example, in my form in most of the fields, I have what is $ strtoupper but I...
asked by 28.08.2018 / 19:47
2
answers

preventDefault () - Before sending by PHP A BBDD (jQuery)

I try to send the information of a form, to a database, so before sending it, I want to check that all the fields that I have marked with "required" are filled in. For this I am trying the following: $("#comprobarDatos").on("click", functio...
asked by 27.08.2018 / 16:58
2
answers

Get current time with php

This code returns the current time, but I need it a minute ago. <input type="text" value="<?php echo date("h:i:s A");?>"> Can you do that if the current time is 2pm; the input show me the 13:59?     
asked by 30.08.2018 / 08:41
1
answer

Variable of a JSON undefined

good to all, again, JSON em is something Troll because it is easy to deal with the data in this way but I do not understand in this case the reason why it does not work, I have this JavaScript code (not yet complete) function ver_bookmark(id_s...
asked by 31.08.2018 / 11:05
2
answers

How to apply str_pad correctly to a string that has asentos

I have this situation, I am applying the function    str_pad to fill a text string with spaces, but the problem is when the string contains accents (accents or ñ), since it tells me that character as if they were two, which causes the str...
asked by 07.09.2018 / 18:56
1
answer

no-referrer-when-downgrade Laravel 5.5

This time I come for your help on another topic. I'm doing a form in Laravel 5.5, to enter a list of servers in a table, This table has many foreign keys. This is the structure of the table: <?php $title = isset($item) ? $item->nam...
asked by 05.09.2018 / 22:02
1
answer

Check with session :: flash in Laravel

My question is about how to deal with this kind of errors. So far I know that this happens because you can not delete a record that depends on another record of another table, which are related. But my question is if you can show another k...
asked by 27.09.2018 / 23:27