Questions tagged as 'php'

1
answer

Use CONCAT or CONCAT_WS in MySQL?

As we already know, MySQL has two functions to concatenate strings: CONCAT and CONCAT_WS . Responding to a question, I saw that CONCAT does not yield the expected results when at least one of the values equals NULL ....
asked by 13.07.2017 / 16:12
4
answers

Table relationships in MySQL

I have a big question about relationships in mysql. You see, I'm creating a site that looks like an e-commerce, it's for a colleague. I'm creating a table called categories and another one called subcategories . In the table subcategories...
asked by 19.07.2017 / 20:49
2
answers

How and when are isset () and empty () used correctly?

I have seen on many occasions when receiving the data of a form the following check: if (isset($_POST['campo1'])) { // Resto de código } What happens if the $_POST['campo1'] value is empty? Or on many other occasions I have se...
asked by 06.11.2016 / 13:51
4
answers

Report between 2 dates in Codeigniter

Excuse me; I get this error when exporting to Excel. Can you tell me why it would be the error? In this part I put the function I did to export to Excel: public function imprimir_excel($FInicial, $FFinal){ //cargando la librer...
asked by 23.07.2016 / 20:01
2
answers

Is this switch behavior normal?

The case It turns out that doing some tests I have found something unusual behavior or that I had not experienced before. The issue is that the switch function allows comparisons to be made consecutively of the type: //... switch ($i...
asked by 14.05.2018 / 12:08
8
answers

How to always get the same results when encrypting a chain?

I have this function that serves to encrypt strings: public function encriptar($string) { $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), MCRYPT_DEV_URANDOM); $encrypted = b...
asked by 12.11.2016 / 10:39
7
answers

How to know what if condition is being fulfilled in PHP

I have a statement IF with several conditions OR there is some way to know what condition is being met: if ($variables_tax_id_next == 201 || $variables_tax_id_next == 206 || $variables_tax_id_next == 211 || $variab...
asked by 18.10.2016 / 00:20
2
answers

Header error - Warning: Can not modify header information - headers already sent

This is the error:    Warning: Can not modify header information - headers already sent by (output started at C: \ xampp \ htdocs \ newop \ template \ header.php: 80) in C: \ xampp \ htdocs \ newop \ mainindex.php on line 16 Line 80 of th...
asked by 09.11.2016 / 10:42
3
answers

Delete an element from an array

Is there an easy way to remove an element from a PHP array, such that foreach ($array) does not include that element anymore? I thought that nullifying it would do it, but apparently not.     
asked by 02.04.2017 / 17:30
2
answers

Obtain the first free or id id in mysql

I would like to know if there is any way to know the first free mysql record, but not the last, if not the first free that exists.    Ex:       I have a busy record 1,2,3,6,7,8,9   the first free would be 5 At the moment I have a code...
asked by 01.02.2017 / 20:37