Précédent   Forum des professionnels en informatique > PHP > PHP & SGBD
PHP & SGBD Forum d'entraide sur les SGBD avec PHP. Avant de poster : FAQ BDD, toutes les FAQ PHP, cours BDD et sources BDD
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 08/10/2006, 23h23   #1
Membre confirmé
 
Matthieu
Étudiant
Inscription : septembre 2004
Messages : 381
Détails du profil
Informations personnelles :
Nom : Matthieu
Âge : 25
Localisation : France

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : septembre 2004
Messages : 381
Points : 278
Points : 278
Par défaut [SQL] lier 2 tables

Bonjour , j'ai un probléme , j'ai tester sur phpmyadmin :

Citation:
SELECT joueur_map.id_client, stat.nom, stat.image
FROM `joueur_map` , `stat`
WHERE joueur_map.id_client = stat.id_client
AND joueur_map.x = '1'
AND joueur_map.y = '1'
AND joueur_map.id_map = '1'
Il me donne :

Citation:
id_client nom image
9 paterson 1
13 Truc much 5555
Se qui est normal .
================================================

Je le passe en php :

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
//test SQL 
include("./conex.ini.php");
$sql="SELECT joueur_map.id_client , stat.nom , stat.image 
FROM `joueur_map`,`stat`
WHERE joueur_map.id_client=stat.id_client
AND joueur_map.x ='1'
AND joueur_map.y = '1'
AND joueur_map.id_map = '1';";
$res = mysql_query($sql);
while($row=mysql_fetch_array($res))
	{
	echo"id=$row[0],Nom:$raw[1] ,,$raw[2]<br>";
	}
?>
il me donne :

Citation:
id=9,Nom: ,,
id=13,Nom: ,,
Je comprend pas ...
paterson est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 09/10/2006, 08h53   #2
Membre expérimenté
 
Avatar de papyphp
 
Inscription : avril 2005
Messages : 425
Détails du profil
Informations personnelles :
Âge : 62
Localisation : Belgique

Informations professionnelles :
Secteur : Enseignement

Informations forums :
Inscription : avril 2005
Messages : 425
Points : 545
Points : 545
Bonjour,


Citation:
echo"id=$row[0],Nom:$row[1] ,,$row[2]<br>";
__________________
Lu kinze d' awousse, la Vierje arandje û dusbrôle lu timp. Et ce coup ci, elle ne nous a pas ratés
papyphp est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 09/10/2006, 19h22   #3
Membre confirmé
 
Matthieu
Étudiant
Inscription : septembre 2004
Messages : 381
Détails du profil
Informations personnelles :
Nom : Matthieu
Âge : 25
Localisation : France

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : septembre 2004
Messages : 381
Points : 278
Points : 278
Merci , beaucoup , honte a moi ... je ferai plus gaffe sur le copier coller ....
paterson est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 17h07.


 
 
 
 
Partenaires

Hébergement Web