Bonjour à tous,
Voilà, j'ai une erreur que je comprends pas trop car je ne sais pas vraiment faire de la POO.
L'erreur est la suivante :
PHP Notice: Undefined property: stdClass::$titre in search.php on line 25, referer: recherche.php
PHP Notice: Undefined property: stdClass::$url_page in search.php on line 25, referer: recherche.php
Comme vous pouvez le constatez, cela vient de la ligne 25...
Mais ne connaissant pas la POO, je ne comprends pas ces choses : $billet->url_page !
Merci d'avance pour votre aide !
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 <?php header("Pragma: no-cache"); header("Expires: 0"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Content-type: application/xml"); $hostsql = "localhost"; $logsql = "root"; $passsql = ""; mysql_connect($hostsql,$logsql,$passsql); mysql_select_db("indesit"); if(!empty($_REQUEST["foo"])) { $rqListBillet = " SELECT * FROM `codes` WHERE `codes_notices_dutilisation` like '" . $_REQUEST["foo"] . "%' ORDER BY `codes_notices_dutilisation` ASC LIMIT 0 , 20"; $rsListBillet = mysql_query($rqListBillet); $xml = "<resultats nb=\"" . mysql_num_rows($rsListBillet) . "\">"; if (mysql_num_rows($rsListBillet) >= 0) { while ($billet = mysql_fetch_object($rsListBillet)) { $xml .= "\n<resultat titre=\"" . str_replace('"', "", $billet->titre) . "\" url=\"/blog/" . $billet->url_page . ".html\" />"; } } } else { $xml = "<resultats nb=\"0\">"; } $xml .= "\n</resultats>"; echo utf8_encode($xml); ?>
Partager