Bonjour,

alors voila le topo :
Je recupere toutes les donnees pour un projet specifique (user, time spent each day, etc...)
Le but est de savoir combien d´heures ca fait au cumule.
donc il faudrait additionner toutes les heures du champ time spent.

erreur reportee :
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\SG\infoproject.php on line 77
Et le code bien sur :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
 
//get all the data for a specific project and all user
$answer6 = mysql_query("SELECT * FROM work WHERE task='".$_POST['task']."'");
 
//get total time spent for a  project
$req = "";
while ($data6 = mysql_fetch_array($answer6) )
	{
		$req = mysql_query("SELECT ADDTIME ('" .$req. "', '".$answer6[time_spent]. "' ");
		$total_hours = mysql_fetch_array($req);
		echo $total_hours[0];
	}