Questions tagged as 'php'

1
answer

htmlspecialchars () expects parameter 1 to be string, object given

I have made a new form element, a zend_form_element that inherits from the text field of zf1 . The fact is that when I use it in a form it sends me this warning:    PHP Warning: htmlspecialchars () expects parameter 1 to be st...
asked by 08.08.2016 / 11:48
1
answer

How to use the values of an array obtained from a MySQL query to perform another MySQL query?

I am using CodeIgniter and I am trying to do it in the following way: $query = $this->db->query("SELECT Tabla1.id From Tabla1 INNER JOIN Tabla2 ON Tabla1.id = Tabla2.id");...
asked by 09.08.2016 / 13:21
1
answer

rare symbols appear when using phpexcel

Good by using phpexcel does not download the document, only rare symbols appear, I would greatly appreciate your help. Thanks in advance. $conexion = new mysqli('','','',''); if (mysqli_connect_errno()) { printf("La conexión con el servido...
asked by 06.07.2016 / 10:02
1
answer

How to display a MySQL table in HTML?

I have a problem linking a DB and displaying it in an HTML page in a table. I made the connection to the database in the following way: <?php $connect = mysql_connect("localhost", "username", "password") or die(mysql_error()); mysql_se...
asked by 07.07.2016 / 14:27
1
answer

Check php and ajax

I have a form with an input type text and a button submit where I write a product code and search in a MySQL database. I show the results in a table within the same page, but how do I make the page not be reloaded by pressing th...
asked by 06.07.2016 / 19:58
1
answer

Problems with two middlewares and abort 401

I'm using two middlewares ROUTE FILE Route::group(['middleware'=>['web','auth']], function() { Route::group(['middleware'=>'administrador'], function() { Route::resource('usuarios', 'UsuariosController'); }); Rout...
asked by 05.07.2016 / 16:50
2
answers

Warning: mysql_fetch_array () expects parameter 1 to be resource, null given in

I make the connection to the database: $db_host="localhost"; $db_nombre="prueba"; $db_user="root"; $db_pass=""; $link=mysql_connect($db_host, $db_user, $db_pass); Now I make the query: $strQuery = "SELECT id, nombre FROM persona"; $re...
asked by 26.07.2016 / 15:25
3
answers

Convert text field to DateTime in PHP

I want to make a query to base de datos in sql server where the field is of type datetime. At the moment of doing this in PHP it shows me the following error:    Warning: strtotime () expects parameter 1 to be string, obj...
asked by 25.07.2016 / 18:07
1
answer

Roles, levels or user privileges Codeigniter

I have a question about the roles or user privileges in Codeigniter, I have a page where I can change the role of each user if he is an administrator or limited user, what I can not do is that when I log in, load his profile if you are an admini...
asked by 25.05.2017 / 14:23
1
answer

Update [closed] does not work

I have a table plazas with the attributes NUMPLAZA , OCUPACION , IDusuario I want to change the value of OCUPACION to OCUPADO using the following query from php: elseif ($row['Cargo'] == "directivo2") {...
asked by 24.05.2017 / 12:35