Questions tagged as 'php'

1
answer

Is it possible to prevent json_encode from changing the accented characters?

I am generating a JSON from a query to the database. When I get the data I store it in an array and then I apply json_encode to create a JSON object. Everything works fine, but I want to know if it is possible to prevent json_encode...
asked by 22.02.2018 / 18:46
3
answers

Header Redirect to a page after validating PHP

Good morning community: I am currently working on a system, the validation redirect, that is, after the system validates all the data entered and proceeds to give access to the system, it always did it in the small projects that I had worked...
asked by 07.05.2018 / 14:33
2
answers

calculate difference between dates

I am trying to calculate the difference between two dates with the format Y-m-d H:i:s for example 2017-04-10 22:39:09 par that shows me the difference of days, hours and minutes. One of the dates will be the one in the BDD and the...
asked by 11.04.2017 / 00:22
6
answers

Connect PHP with SQL SERVER

I have searched everywhere, but I can not find an answer or find incomplete answers. What is the complete way to connect PHP with SQL Server 2008?     
asked by 29.04.2016 / 17:39
1
answer

How to restart the auto_increment of MYSQL?

Good morning. I'm doing a little job with PHP, and I need help removing a record from a table. I insert data, and then I delete them, but the auto_increment continues in the last inserted position. I want that when deleting a data, the auto_incr...
asked by 30.05.2016 / 04:53
1
answer

Warning: mysqli_query () expects parameter 1 to be mysqli

I have the following code <?php function consulta () { global $conexion; $dbhost = "localhost"; $dbuser = "root"; $dbpass = ""; $bd = "alumnos"; $conexion = mysqli_connect($dbhost, $dbuser, $dbpass, $bd); $result = mysqli_query('SELECT...
asked by 28.09.2017 / 06:15
2
answers

Is it correct to use the same id and name in the input of an html form?

I would like to know if it is a good practice to place the same in id and in name when I am going to program, for example, in HTML and PHP. Could it affect the code when it is already advanced? What consequences could it have to do?     
asked by 19.04.2017 / 02:28
4
answers

session_start (): Can not start session when headers already sent

I receive this warning that does not allow me to continue:    Warning: session_start (): Can not start session when headers already sent in C: \ xampp \ htdocs \ bancoinfocial \ index.php on line 45       Notice: Undefined variable: _SESSION...
asked by 19.04.2018 / 15:41
1
answer

How is the integration of 2 htaccess with ptpasswd?

Ask a question and very kind Alvaro has answered, only that I do not understand codes and I do not know how to integrate with path's the question and answer was this:    If I have 2 htaccess files in different directories? Do I need to create...
asked by 22.04.2016 / 20:36
2
answers

Switch case in PHP with variable

My question is this, I'm doing a Telegram bot with user help in various cases. I would like to capture a piece of the message that you send me to use it as a variable, that is: switch($mensaje) case '/tiempo Madrid': $ciudad="Madrid";...
asked by 26.07.2018 / 18:10