Questions tagged as 'php'

1
answer

Access a variable declared in a class in PHP

I have a simple doubt about PHP. I have the following code in a file called gato.php: class Animal{ public $foodLevel=5; } class Cat extends Animal{ } Then I have another file in which I have: include_once "gato.php"; $susi = new Cat(...
asked by 29.07.2017 / 20:17
1
answer

Temporary table in MYSQL and its use in PHP

I'm doing this code: <?php $tempSQL = "CREATE TEMPORARY TABLE IF NOT EXISTS tempUsers SELECT CONCAT(NOMBRE,' 'AP_PATERNO,' ',AP_MATERNO) AS NOMBRE, EMP_ID, AREA FROM EMPLEADOS WHERE ESTADO = 1"; mysqli_query($conn,$tempSQL); if(mysqli_affe...
asked by 23.06.2017 / 02:26
1
answer

mysqli_fetch_assoc in object-oriented style

I'm getting values from an associative array $datos = ""; $array = array(1, 2, 3, 4); foreach ($array as $valor => $dato) { $datos = $datos . $dato . ","; } $app = rtrim($datos, ","); echo $app; Result: 1,2,3,4...
asked by 26.11.2017 / 22:37
1
answer

php error Message: Unsupported operand types

Hi, I'm doing a php operation with parentheses; and I get this error error code: Fatal error: Unsupported operand types in C:\xampp\htdocs\olPrueba2\application\controllers\Admin.php on line 705 A PHP Error was encountered Seve...
asked by 07.04.2018 / 00:56
1
answer

Query two different tables and show in the blade view?

Table 1 news Table 2 notes The following controller makes a query to the news table. The search engine makes the query with three different fields. The question is how to make the query from the table (notes) at the same time as the news t...
asked by 06.04.2018 / 22:37
1
answer

Concatenate variable php with sql query

It does not let me concatenate the following query, it throws me error $consulta_url="select url from urlspeliculas where idioma='$idiomas[$f][$g]'"; the last bracket in $ languages [$ f] [$ g] I take it as text, some solution?...
asked by 29.01.2018 / 03:24
1
answer

Incorrect Data to Get COUNT value of a query with rowCount PDO - PHP

I'm doing a query on the model of a web application in PHP with MVC . The idea is to make a query in which to put the value in empresa_id I see the total rows with that company, for this I used COUNT() in the query...
asked by 06.04.2018 / 18:23
1
answer

Connecting Php with SQLServer 2000

<?php $server = "10.7.0.202"; $database = "GERENCIA"; $user = "sa"; $password = ""; $conexión = odbc_connect("Driver={SQL Server Native Client 10.0};Server=$server;Database=$database;", $user, $password); ?> I am looking to connect to a...
asked by 18.01.2018 / 03:46
3
answers

As insert invisible characters (hidden) in a text

A while ago I saw a website in English that I was unable to translate with any online translator, including Google translator. This is a piece of text:    Саrrоts аrе nоt јust fоr Вugs Вunnу! Іt іs а rісh sоurсе оf nесеssаrу   nutrіеnts аn...
asked by 28.06.2016 / 04:40
3
answers

301 redirect htaccess /% E2% 80% 8E

I am not able to redirect a www.miweb.com/%E2%80%8E to www.miweb.com I tried htaccess: Redirect 301 /%E2%80%8E http://www.miweb.com Php $cadena = 'http://www.miweb.com/%E2%80%8E'; if(preg_match('/\/%E2%80%8E/', $cadena)){ header( "...
asked by 01.07.2016 / 11:54