[Régler] Champ impossible à récupérer dans la BDD

Ce forum aborde toutes les questions qu'un codeur ou webmaster pourrait se poser, et n'ayant aucun rapport direct avec phpBB.
Tout ce qui peut concerner la récupération des sessions de phpBB sur votre site, doit se faire dans cette section.

Modérateur : Équipe

Règles du forum
A lire impérativement : Règlement de phpBB-fr.com
Répondre
Fantole
Grand-maître des floodeurs
Grand-maître des floodeurs
Messages : 3082
Enregistré le : 09 déc. 2004 à 10:32
Localisation : Sur le Web

[Régler] Champ impossible à récupérer dans la BDD

Message par Fantole »

Bonjour @ tous ;)

je rencontre un problème pour récupérer un champ de ma BDD.

Ce champ s'appel place_pour_match

J'ai une requète SQL qui fonctionne bien car j'ai plusieurs autres champs qui sont récupéré sans aucun problème.

Voici les champ contenues dans ma table

Image

Seul le champ place_pour_match n'est pas récupéré :cry:

Pourtant voici un morceau de ma page qui attribue les valeurs qu'il faut dans le tpl

Code : Tout sélectionner

if(!$result = $db->sql_query($sql)) 
{ 
     message_die(GENERAL_ERROR, 'impossible de consulter la table match', '', __LINE__, __FILE__, $sql); 
} 
$row_match = $db->sql_fetchrowset($result);
$count_match = $db->sql_numrows($result);
		
$sql = "SELECT *
		FROM ". MATCH_CONFIG_TABLE ;
		
if(!$result = $db->sql_query($sql)) 
{ 
     message_die(GENERAL_ERROR, 'impossible de consulter la table match_config', '', __LINE__, __FILE__, $sql); 
} 
$row_config = $db->sql_fetchrow($result);

if ($row_config['match_value'] == '0')
{

$template->set_filenames(array(
	'Mod_match' => 'match.tpl',
	));

for($nb_actuel = 0; $nb_actuel < $count_match; $nb_actuel++)
{

if ($row_match[$nb_actuel]['participants'] == '')
	{
$participants[$nb_actuel] = $lang['no_player'];
	}
else 
{
$participants[$nb_actuel] = htmlspecialchars ($row_match[$nb_actuel]['participants']);
}

$id_match = htmlspecialchars ($row_match[$nb_actuel]['id_match']);
$t_place_pour_match = htmlspecialchars ($row_match[$nb_actuel]['place_pour_match']);
$html_code_haut = $row_match[$nb_actuel]['htmlcodehaut'];
$html_code_bas = $row_match[$nb_actuel]['htmlcodebas'];
$t_contre = htmlspecialchars ($row_match[$nb_actuel]['adversaire']);
$t_date_jour = htmlspecialchars ($row_match[$nb_actuel]['date_jour']);
$t_date_mois = htmlspecialchars ($row_match[$nb_actuel]['date_mois']);
$t_date_annee = htmlspecialchars ($row_match[$nb_actuel]['date_annee']);
$t_heure_heure = htmlspecialchars ($row_match[$nb_actuel]['heure']);
$t_heure_minute = htmlspecialchars ($row_match[$nb_actuel]['minute']);
$t_type = htmlspecialchars ($row_match[$nb_actuel]['type']);
$t_type2 = htmlspecialchars ($row_match[$nb_actuel]['type2']);
$t_mode = htmlspecialchars ($row_match[$nb_actuel]['mode']);
$t_restriction = htmlspecialchars ($row_match[$nb_actuel]['restriction']);
$t_leur_camp = htmlspecialchars ($row_match[$nb_actuel]['leur_camp']);
$t_notre_camp = htmlspecialchars ($row_match[$nb_actuel]['notre_camp']);
$t_leur_map = htmlspecialchars ($row_match[$nb_actuel]['leur_map']);
$t_notre_map = htmlspecialchars ($row_match[$nb_actuel]['notre_map']);
$t_commentaires = htmlspecialchars ($row_match[$nb_actuel]['commentaires']);
$t_participants = htmlspecialchars ($participants[$nb_actuel]);


$template->assign_vars(array(
'T_PLACE_POUR_MATCH' => $t_place_pour_match,
'HTMLCODEHAUT' => $html_code_haut,
'HTMLCODEBAS' => $html_code_bas,
'CONTRE' => $lang['Contre'],
'DATE' => $lang['Date'],
'HEURE' => $lang['Heure'],
'TYPE' => $lang['Type'],
'MODE' => $lang['Mode'],
'RESTRICTION' => $lang['Restriction'],
'LEUR_CAMP' => $lang['Leur_Camp'],
'NOTRE_CAMP' => $lang['Notre_Camp'],
'LEUR_MAP' => $lang['Leur_MAP'],
'NOTRE_MAP' => $lang['Notre_MAP'],
'COMMENTAIRES_ET_PARTICIPANT' => $lang['Commentaires_participants'],
'T_NOTRE_MAP' => $t_notre_map,
'T_CONTRE' => $t_contre,
'T_DATE_JOUR' => $t_date_jour,
'T_DATE_MOIS' => $t_date_mois,
'T_DATE_ANNEE' => $t_date_annee,
'T_HEURE_HEURE' => $t_heure_heure,
'T_HEURE_MINUTE' => $t_heure_minute,
'T_TYPE' => $t_type,
'T_TYPE2' => $t_type2,
'T_MODE' => $t_mode,
'T_RESTRICTION' => $t_restriction,
'T_LEUR_CAMP' => $t_leur_map,
'T_NOTRE_CAMP' => $t_notre_camp,
'T_LEUR_MAP' => $t_leur_map,
'T_COMMENTAIRES' => ( $board_config['allow_smilies'] ) ? smilies_pass($row_match[$nb_actuel]['commentaires']) : $row_match[$nb_actuel]['commentaires'],
'ID_MATCH' => $id_match,
'T_PARTICIPANTS' => $t_participants,
'L_SUBMIT_PSEUDO' => $lang['Submit_pseudo'],
'L_PLUS_PSEUDO' => $lang['Plus_pseudo'],
'L_ID_MATCH' => $lang['id_du_match'],
'L_PLACE_MATCH' => $lang['L_Place_match'],
"S_PSEUDO_ACTION" => append_sid("index.$phpEx"),
)
);

	$template->pparse('Mod_match');
}
}
Mon tpl ressemble à sa

Code : Tout sélectionner

{HTMLCODEHAUT}
<form action="{S_PSEUDO_ACTION}" method="post"><table width="100%" border="0" cellspacing="1" cellpadding="1" align="center" class="forumline">
  <tr>
    <th><div align="center">{CONTRE}</td></div>
    <th><div align="center">{DATE}</td></div>
    <th><div align="center">{HEURE}</div></td>
    <th><div align="center">{TYPE}</div></td>
    <th><div align="center">{MODE}</div></td>
    <th><div align="center">{RESTRICTION}</div></td>
    <th><div align="center">{LEUR_CAMP}</div></td>
    <th><div align="center">{NOTRE_CAMP}</div></td>
    <th><div align="center">{LEUR_MAP}</div></td>
    <th><div align="center">{NOTRE_MAP}</div></td>
  </tr>	
  <tr>
    <td class="row2"><div align="center" class="gen">{T_CONTRE}</div></td>
    <td class="row2"><div align="center" class="gen">{T_DATE_JOUR}/{T_DATE_MOIS}/{T_DATE_ANNEE}</div></td>
    <td class="row2"><div align="center" class="gen">{T_HEURE_HEURE}H{T_HEURE_MINUTE}</div></td>
    <td class="row2"><div align="center" class="gen">{T_TYPE} VS {T_TYPE2}</div></td>
    <td class="row2"><div align="center" class="gen">{T_MODE}</div></td>
    <td class="row2"><div align="center" class="gen">{T_RESTRICTION}</div></td>
    <td class="row2"><div align="center" class="gen">{T_LEUR_CAMP}</div></td>
    <td class="row2"><div align="center" class="gen">{T_NOTRE_CAMP}</div></td>
    <td class="row2"><div align="center" class="gen">{T_LEUR_MAP}</div></td>
    <td class="row2"><div align="center" class="gen">{T_NOTRE_MAP}</div></td>
  </tr>
  </table>
  <table width="100%" border="0" cellpadding="1" cellspacing="1" align="center" class="forumline">
   <tr>
		<th><div align="center">{L_ID_MATCH}</div></td>
		<th><div align="center">{L_PLACE_MATCH}</div></td>
   </tr>
   <tr>
   <td class="row2" align="center"><input style="text-align:center;" name="id_match" type="text" class="post" value="{ID_MATCH}" size="3" maxlength="10" readonly></td>
   
   <td class="row2" align="center"><input style="text-align:center;" name="place_pour_match" type="text" class="post" value="{T_PLACE_POUR_MATCH}" size="3" maxlength="10" readonly></td>
   
   </tr>
</table>
  <table width="100%" border="0" cellpadding="1" cellspacing="1" align="center" class="forumline">
  <tr>
    <th width="100%"><div align="center">{COMMENTAIRES_ET_PARTICIPANT}</div></td>
   </tr>
   
   <tr>
    <td class="row2" width="100%"><div align="center" class="gen">{T_COMMENTAIRES}</div></td>
   </tr>
   <tr>
   <td class="row2" align="center"><input style="text-align:center;" name="participant" type="text" class="post" value="{T_PARTICIPANTS}" size="150" maxlength="200" readonly></td>
   </tr>
   <tr>
		<td class="catBottom" colspan="2" align="center"><input type="submit" name="present" value="{L_SUBMIT_PSEUDO}" class="mainoption" />&nbsp;&nbsp;<input type="submit" name="plus_present" value="{L_PLUS_PSEUDO}" class="mainoption" /></td>
	</tr>
	
</table>

{S_HIDDEN_FIELDS}</form>

{HTMLCODEBAS}
<br/>
J'ai beau recherché et modifier, mais rien n'y fait :? :?:

J'aurais dépassé la mémoire possible pour stocker dans des variables ?

Si c'est le cas comment faire ?

pourtant quand j'enlève des variables sa passe toutjours pas :cry:

Merci @ toutes personnes pouvant m'aider :wink:
Modifié en dernier par Fantole le 07 sept. 2006 à 09:19, modifié 1 fois.
Elglobo
Floodeur universel
Floodeur universel
Messages : 14940
Enregistré le : 13 oct. 2004 à 17:28
Contact :

Message par Elglobo »

Salut Fantole,

Comment va ?
Bon pour revenir au sujet :-D cela vient à mon avis tout simplement du nom de ton champs, contenant MATCH qui est un mot clé de MYSQL.

Essaye pour test de renommer ce champs en retirant match et de voir si ca fonctionne :wink:

Ce n'est pas un problème de mémoire en tous cas :wink:
phpBB-Services.com: L'hébergement et l'assistance de votre forum phpBB en toute tranquillité.
Fantole
Grand-maître des floodeurs
Grand-maître des floodeurs
Messages : 3082
Enregistré le : 09 déc. 2004 à 10:32
Localisation : Sur le Web

Message par Fantole »

Salut Elglobo :wink:

Et bien, tout va bien à part ce petit problème :lol:

J'espère qu'il en va de même pour toi 8)

Sinon et bien j'ai testé ce que tu m'a dit

Le champ s'appel désormait place_libre

Et toutes les variables T_PLACE_LIBRE, $tplace_libre, etc....

Mais sans succès :cry:

Mon tableau qui affiche le résultat reste vide 8O

Mais après une grande recherche j'ai honte de ma découverte :oops:

J'avais créé ce champ dans l'ancienne BDD de développement de mon MOD :lol:

Un vrai boulet :arrow: :arrow:

En tout cas merci @ toi Eglobo :wink:
Elglobo
Floodeur universel
Floodeur universel
Messages : 14940
Enregistré le : 13 oct. 2004 à 17:28
Contact :

Re

Message par Elglobo »

Ah ok d'ailleurs je viens de vérifier en plus ce que je te disais, cela aurait été en fait génant si c'était le début du champs qui commencait ainsi.

Tout est bien qui finit bien :wink:
phpBB-Services.com: L'hébergement et l'assistance de votre forum phpBB en toute tranquillité.
Répondre

Retourner vers « Coding, Webmastering et Sécurité informatique »

Qui est en ligne

Utilisateurs parcourant ce forum : Aucun utilisateur enregistré et 4 invités