Précédent   Forum des professionnels en informatique > PHP > PHP & SGBD > PHP & MySQL
PHP & MySQL Forum d'entraide sur les fonctions MySQL avec PHP. Avant de poster -> FAQ MySQL, Cours MySQL et Sources MySQL. Pour les questions concernant le moteur MySQL plutôt que les fonctions PHP, merci d'utiliser le forum MySQL.
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 11/05/2011, 12h22   #1
Invité de passage
 
Homme
Webmaster
Inscription : mai 2011
Messages : 4
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

Informations professionnelles :
Activité : Webmaster
Secteur : Enseignement

Informations forums :
Inscription : mai 2011
Messages : 4
Points : 1
Points : 1
Par défaut affichage non complet des données

Bonjour - debutant en php - je travaille sur Dreamweaver et phpmyadmin via Wamp.
J'ai importé des données qui s'affichent en totalité dans ma table phpmyadmin. Après création de jeux d'enregistrements dans dreamweaver (dont les données s'affichent en totalité lors de test du jeu d'enregistrement), certaines données n'affichent que le début de leur valeur (les 20 premiers caractères environ) sur la page php. Pour la structure de la colonne, j'ai testé avec varchar(255) puis text mais rien n'y fait.
Auriez-vous une piste de recherche ou une solution à me proposer.
merci d'avance
bellibaste est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 11/05/2011, 12h29   #2
Membre du Club
 
Inscription : août 2009
Messages : 66
Détails du profil
Informations forums :
Inscription : août 2009
Messages : 66
Points : 69
Points : 69
Si tu nous fais voir le code PHP de ta page, ce sera probablement plus facile de te venir en aide.
NicoD. est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 11/05/2011, 13h41   #3
Modérateur
 
Avatar de CinePhil
 
Homme Philippe Leménager
Ingénieur d'études en informatique
Inscription : août 2006
Messages : 10 998
Détails du profil
Informations personnelles :
Nom : Homme Philippe Leménager
Âge : 48
Localisation : France, Haute Garonne (Midi Pyrénées)

Informations professionnelles :
Activité : Ingénieur d'études en informatique
Secteur : Enseignement

Informations forums :
Inscription : août 2006
Messages : 10 998
Points : 18 262
Points : 18 262
Envoyer un message via MSN à CinePhil
Citation:
Envoyé par bellibaste Voir le message
J'ai importé des données qui s'affichent en totalité dans ma table phpmyadmin.
Donc ce n'est pas un problème de type de colonne mais un problème d'affichage dans ton programme PHP.
__________________
Philippe Leménager. Ingénieur d'étude à l'École Nationale de Formation Agronomique.
Mon blog sur la conception des BDD, le langage SQL, le PHP avec Zend Framework...
« Ce que l'on conçoit bien s'énonce clairement, et les mots pour le dire arrivent aisément ». (Nicolas Boileau)
À la maison comme au bureau, j'utilise Mandriva Linux ou Mageïa ! Soutenons l'industrie logicielle française !
Linuxiens, comptez-vous !
CinePhil est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 11/05/2011, 14h41   #4
Invité de passage
 
Homme
Webmaster
Inscription : mai 2011
Messages : 4
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

Informations professionnelles :
Activité : Webmaster
Secteur : Enseignement

Informations forums :
Inscription : mai 2011
Messages : 4
Points : 1
Points : 1
Par défaut code php de ma page

<?php require_once('Connections/complet2011.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

$colname_Resultat = "-1";
if (isset($_POST['liste'])) {
$colname_Resultat = $_POST['liste'];
}
mysql_select_db($database_complet2011, $complet2011);
$query_Resultat = sprintf("SELECT * FROM complet2011 WHERE id = %s", GetSQLValueString($colname_Resultat, "int"));
$Resultat = mysql_query($query_Resultat, $complet2011) or die(mysql_error());
$row_Resultat = mysql_fetch_assoc($Resultat);
$totalRows_Resultat = mysql_num_rows($Resultat);
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<div id="resultat">
<h2><?php echo $row_Resultat['tgi']; ?>
</h2>
<table border="0" cellpadding="2" cellspacing="0" >


<tr class="colorBrown">
<td width="257" ><h1>Commune de</h1></td>
<td width="455" ><h1><?php echo $row_Resultat['commune']; ?></h1></td>
</tr>
<tr>
<td >r&eacute;gion</td>
<td ><?php echo $row_Resultat['region']; ?></td>
</tr>
<tr class="colorBrown">
<td >chef lieu de r&eacute;gion</td>
<td ><?php echo $row_Resultat['cheflieuregion']; ?></td>
</tr>
<tr>
<td >d&eacute;partement</td>
<td ><?php echo $row_Resultat['departement']; ?></td>
</tr>
<tr class="colorBrown">
<td >n&deg; de d&eacute;partement</td>
<td ><?php echo $row_Resultat['departement_numero']; ?></td>
</tr>
<tr>
<td >chef lieu de d&eacute;partement</td>
<td ><?php echo $row_Resultat['departement_chef_lieu']; ?></td>
</tr>
<tr>
<td >commune</td>
<td ><?php echo $row_Resultat['commune']; ?></td>
</tr>
<tr>
<td >n&deg; insee</td>
<td ><?php echo $row_Resultat['insee']; ?></td>
</tr>
<tr>
<td >code postal</td>
<td ><?php echo $row_Resultat['codepostal']; ?></td>
</tr>
<tr>
<td >canton</td>
<td ><?php echo $row_Resultat['canton']; ?></td>
</tr>
<tr>
<td >arrondissement</td>
<td ><?php echo $row_Resultat['arrondissement']; ?></td>
</tr>
<tr>
<td >cdi</td>
<td ><?php echo $row_Resultat['cdi']; ?></td>
</tr>
<tr>
<td >csie</td>
<td ><?php echo $row_Resultat['csie']; ?></td>
</tr>
<tr>
<td >sie</td>
<td ><?php echo $row_Resultat['sie']; ?></td>
</tr>
<tr>
<td >sie centre</td>
<td ><?php echo $row_Resultat['sie_centre']; ?></td>
</tr>
<tr>
<td >foncier</td>
<td ><?php echo $row_Resultat['foncier']; ?></td>
</tr>
<tr>
<td >hypotheques</td>
<td ><?php echo $row_Resultat['hypotheques']; ?></td>
</tr>
<tr>
<td >tribunal administratif</td>
<td ><?php echo $row_Resultat['tal_admin']; ?></td>
</tr>
<tr>
<td >cour d'appel administrative</td>
<td ><?php echo $row_Resultat['cour_appel_admin']; ?></td>
</tr>
<tr>
<td >tribunal du commerce</td>
<td ><?php echo $row_Resultat['tal_commerce']; ?></td>
</tr>
<tr>
<td >cour d'appel</td>
<td ><?php echo $row_Resultat['cour_appel']; ?></td>
</tr>
<tr>
<td >cour d'assises</td>
<td ><?php echo $row_Resultat['cour_assises']; ?></td>
</tr>
<tr>
<td >prud'hommes</td>
<td ><?php echo $row_Resultat['prudhommes']; ?></td>
</tr>
<tr>
<td >tgi</td>
<td ><?php echo $row_Resultat['tgi']; ?></td>
</tr>
<tr>
<td >ti</td>
<td ><?php echo $row_Resultat['ti']; ?></td>
</tr>
</table>


</div>

</body>
</html>
<?php
mysql_free_result($Resultat);
?>
bellibaste est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 11/05/2011, 15h08   #5
Modérateur
 
Avatar de CinePhil
 
Homme Philippe Leménager
Ingénieur d'études en informatique
Inscription : août 2006
Messages : 10 998
Détails du profil
Informations personnelles :
Nom : Homme Philippe Leménager
Âge : 48
Localisation : France, Haute Garonne (Midi Pyrénées)

Informations professionnelles :
Activité : Ingénieur d'études en informatique
Secteur : Enseignement

Informations forums :
Inscription : août 2006
Messages : 10 998
Points : 18 262
Points : 18 262
Envoyer un message via MSN à CinePhil
Illisible !
Utilise les balises :code: (bouton # dans l'éditeur de message).
Je ne suis pas modo de cette section donc je ne peux corriger.
__________________
Philippe Leménager. Ingénieur d'étude à l'École Nationale de Formation Agronomique.
Mon blog sur la conception des BDD, le langage SQL, le PHP avec Zend Framework...
« Ce que l'on conçoit bien s'énonce clairement, et les mots pour le dire arrivent aisément ». (Nicolas Boileau)
À la maison comme au bureau, j'utilise Mandriva Linux ou Mageïa ! Soutenons l'industrie logicielle française !
Linuxiens, comptez-vous !
CinePhil est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 11/05/2011, 17h05   #6
Invité de passage
 
Homme
Webmaster
Inscription : mai 2011
Messages : 4
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

Informations professionnelles :
Activité : Webmaster
Secteur : Enseignement

Informations forums :
Inscription : mai 2011
Messages : 4
Points : 1
Points : 1
Code :
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?php require_once('Connections/complet2011.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
 
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
 
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
 
$colname_Resultat = "-1";
if (isset($_POST['liste'])) {
$colname_Resultat = $_POST['liste'];
}
mysql_select_db($database_complet2011, $complet2011);
$query_Resultat = sprintf("SELECT * FROM complet2011 WHERE id = %s", GetSQLValueString($colname_Resultat, "int"));
$Resultat = mysql_query($query_Resultat, $complet2011) or die(mysql_error());
$row_Resultat = mysql_fetch_assoc($Resultat);
$totalRows_Resultat = mysql_num_rows($Resultat);
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<div id="resultat">
<h2><?php echo $row_Resultat['tgi']; ?>
</h2>
<table border="0" cellpadding="2" cellspacing="0" >
 
 
<tr class="colorBrown">
<td width="257" ><h1>Commune de</h1></td>
<td width="455" ><h1><?php echo $row_Resultat['commune']; ?></h1></td>
</tr>
<tr>
<td >r&eacute;gion</td>
<td ><?php echo $row_Resultat['region']; ?></td>
</tr>
<tr class="colorBrown">
<td >chef lieu de r&eacute;gion</td>
<td ><?php echo $row_Resultat['cheflieuregion']; ?></td>
</tr>
<tr>
<td >d&eacute;partement</td>
<td ><?php echo $row_Resultat['departement']; ?></td>
</tr>
<tr class="colorBrown">
<td >n&deg; de d&eacute;partement</td>
<td ><?php echo $row_Resultat['departement_numero']; ?></td>
</tr>
<tr>
<td >chef lieu de d&eacute;partement</td>
<td ><?php echo $row_Resultat['departement_chef_lieu']; ?></td>
</tr>
<tr>
<td >commune</td>
<td ><?php echo $row_Resultat['commune']; ?></td>
</tr>
<tr>
<td >n&deg; insee</td>
<td ><?php echo $row_Resultat['insee']; ?></td>
</tr>
<tr>
<td >code postal</td>
<td ><?php echo $row_Resultat['codepostal']; ?></td>
</tr>
<tr>
<td >canton</td>
<td ><?php echo $row_Resultat['canton']; ?></td>
</tr>
<tr>
<td >arrondissement</td>
<td ><?php echo $row_Resultat['arrondissement']; ?></td>
</tr>
<tr>
<td >cdi</td>
<td ><?php echo $row_Resultat['cdi']; ?></td>
</tr>
<tr>
<td >csie</td>
<td ><?php echo $row_Resultat['csie']; ?></td>
</tr>
<tr>
<td >sie</td>
<td ><?php echo $row_Resultat['sie']; ?></td>
</tr>
<tr>
<td >sie centre</td>
<td ><?php echo $row_Resultat['sie_centre']; ?></td>
</tr>
<tr>
<td >foncier</td>
<td ><?php echo $row_Resultat['foncier']; ?></td>
</tr>
<tr>
<td >hypotheques</td>
<td ><?php echo $row_Resultat['hypotheques']; ?></td>
</tr>
<tr>
<td >tribunal administratif</td>
<td ><?php echo $row_Resultat['tal_admin']; ?></td>
</tr>
<tr>
<td >cour d'appel administrative</td>
<td ><?php echo $row_Resultat['cour_appel_admin']; ?></td>
</tr>
<tr>
<td >tribunal du commerce</td>
<td ><?php echo $row_Resultat['tal_commerce']; ?></td>
</tr>
<tr>
<td >cour d'appel</td>
<td ><?php echo $row_Resultat['cour_appel']; ?></td>
</tr>
<tr>
<td >cour d'assises</td>
<td ><?php echo $row_Resultat['cour_assises']; ?></td>
</tr>
<tr>
<td >prud'hommes</td>
<td ><?php echo $row_Resultat['prudhommes']; ?></td>
</tr>
<tr>
<td >tgi</td>
<td ><?php echo $row_Resultat['tgi']; ?></td>
</tr>
<tr>
<td >ti</td>
<td ><?php echo $row_Resultat['ti']; ?></td>
</tr>
</table>
 
 
</div>
 
</body>
</html>
<?php
mysql_free_result($Resultat);
?>
bellibaste est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 11/05/2011, 18h48   #7
Invité de passage
 
Homme
Webmaster
Inscription : mai 2011
Messages : 4
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

Informations professionnelles :
Activité : Webmaster
Secteur : Enseignement

Informations forums :
Inscription : mai 2011
Messages : 4
Points : 1
Points : 1
Par défaut reponse - resolu

en fait, c'est un bug d'affichage en local qui disparait quand le fichier est en ligne.
merci pour les personnes ayant apporté leur contribution
bellibaste 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 07h53.


 
 
 
 
Partenaires

Hébergement Web