Bonjour,

Je sais pas si je suis dans la bonne section du forum si pas je m'en excuse.

J'ai un souci avec ma requete, je me connecte en ODBC sur l'AS400.

Voici mon code:

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
34
35
36
37
38
39
40
41
42
43
 
<html>
	<head>
		<title></title>
	</head>
	<body>
 
	<?PHP
		/*#######################*/	
	   /*#CONNEXION A L'AS400  #*/
	  /*#######################*/	
 
		$dsn = "******"; /* Nom du lien ODBC mis dans le fichier de configuration odbc.ini */
		$user = "******"; /* Votre nom d’utilisateur AS400 */
		$passwd = "******"; /* Mot de passé AS400 */
		$connAs400 = odbc_connect($dsn,$user,$passwd );	
 
		if ($connAs400 <= 0) 
		{
			echo "Erreur dans la connexion<BR>";
			exit;
		}
		else 
		{
			$query = "SELECT nompre as Nom_Prenom,datent as date_entree ,datope as date_ope,intlib as Intervention,case(cp) when ' ' then 'CC' else 'CP'end as Type_cham,pbdob as Date_nais,pbsex as sexe,nomm as Chirurgien,datent+nbrjrs days as Date_sortie, 
                                     case dayofweek_iso(datent)
                                     when 1 then 'Lundi 
                                     when 2 then 'Mardi' 
                                     when 3 then 'Mercredi'
                                     when 4 then 'Jeudi'
                                     when 5 then 'Vendredi'
                                     when 6 then 'Samedi'
                                     else        'Dimanche'
                                     end as jour 
                                     from 
                                     sysibm.sysdummy1,
                                     program.zp5reser,medcpof.sptml0,medcpofb.smedec where pbmrn=dos7a and datent>=current_date and datent<=current_date + 15 days and meopen=nrpr"
			$result = odbc_exec($connAs400, $query);
}
 
		odbc_close($connAs400);
 
	?>
Le message d'erreur:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
 
Parse error: syntax error, unexpected T_VARIABLE in C:\Program Files\EasyPHP-5.3.8.1\www\LISTING_BLOC.php on line 38
La ligne 38 correspond à $result = odbc_exec($connAs400, $query);

Je ne trouve pas mon erreur !

Si j’exécute la même requête a partir de VB.net ça fonctionne

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
Dim str_requete As String = "SELECT nompre as Nom_Prenom,datent as date_entree ,datope as date_ope,intlib as Intervention,case(cp) when ' ' then 'CC' else 'CP'end as Type_cham,pbdob as Date_nais,pbsex as sexe,nomm as Chirurgien,datent+nbrjrs days as Date_sortie, " & _
                                     " case dayofweek_iso(datent)" & _
                                     "when 1 then 'Lundi'" & _
                                     "when 2 then 'Mardi'" & _
                                     "when 3 then 'Mercredi'" & _
                                     "when 4 then 'Jeudi'" & _
                                     "when 5 then 'Vendredi'" & _
                                     "when 6 then 'Samedi'" & _
                                     "else        'Dimanche'" & _
                                     "end as jour " & _
                                     "from " & _
                                     "sysibm.sysdummy1," & _
                                     "program.zp5reser,medcpof.sptml0,medcpofb.smedec where pbmrn=dos7a and datent>=current_date and datent<=current_date + 15 days and meopen=nrpr"
Si quelqu'un a une idée.

D'avance merci