Bonjour,

Je suis très débutante en PHP, c'est pourquoi je n'arrive pas à comprendre une erreur récurrente :
Notice: Undefined index: REQ_REF in C:\wamp\www\Sandy\Projet PHP 2009-2010\public\product.php on line 3

Warning: mysql_result() expects parameter 1 to be resource, boolean given in C:\wamp\www\Sandy\Projet PHP 2009-2010\lib\inc-func.php on line 113

Warning: mysql_result() expects parameter 1 to be resource, boolean given in C:\wamp\www\Sandy\Projet PHP 2009-2010\lib\inc-func.php on line 113

Voici les fonctions concernées :

La page product.php:
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
 
<?php
	require_once("../lib/inc-func.php");
	print(product($_REQUEST['REQ_REF']));
?>
 
Fonctions de inc-func.php:
 
function product($ref){
		$windows_title="product"; $text_banner=name_by_ref($ref);
		$content=image_by_ref($ref);
		return store_page($windows_title, $text_banner, $content); }
 
function name_by_ref($ref){
	//connect_select_db();
	mysql_connect("localhost","root","") or die(mysql_error());
	mysql_select_db("prog");
	//$sql="SELECT name FROM prog WHERE ref= %d;" ;
	$sql=mysql_query("SELECT name FROM prog WHERE ref = ".mysql_real_escape_string($ref));
	//print_r($result);
	$result= mysql_query(sprintf($sql, $ref));
	return mysql_result($result, 0); 
}
(La ligne 113 est l'avant dernière, le return)





Si vous pouviez m'aider ce serait génial, je patauge depuis des jours !! Merci!