IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

PHP & Base de données Discussion :

probleme de stockage complet de données dans un champs


Sujet :

PHP & Base de données

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé
    Homme Profil pro
    Développeur Web
    Inscrit en
    Mars 2008
    Messages
    298
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Mars 2008
    Messages : 298
    Par défaut probleme de stockage complet de données dans un champs
    salut j'ai effectuer un formulaire newslettre qui comporte titre et contenu et une bouton insertion au table newslettre
    ma table newslettre comporte 4 champs (num_auto(int), titre(varchar), contenu(text), date_envoi(datetime))

    tous marchera bien l'ajout dans la table etc sauf un probleme c'est au niveau du champs contenu

    il m'insert pas toute les données que j'ai saisies exemple

    exemple ma newslettre :
    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
    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
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Document sans nom</title>
    <style type="text/css">
    .header1 {
    background-color:#FF6600;
    background-image:url(http://www.monsite.com/img/logo.jpg);
    background-repeat:no-repeat;
    background-position:10px 10px;
    font: normal 24px Arial, Helvetica, sans-serif;
    color: #fff;
    }
    .edito {
    border: 2px solid #0099CC;
    padding:15px;
    line-height:18px;
    }
    h1.article1 {
    font: bold 13px Georgia, "Times New Roman", Times, serif;
    color:#f60;
    border-bottom: 1px solid #f60;
    margin-top:20px;
    }
    h2.breves1 {font: bold 11px Verdana, Arial, Helvetica, sans-serif;
    color:#f60;
    }
    </style>
    </head>
     
    <body>
    <table width="644" height="483" border="1">
      <tr>
        <td height="98" colspan="2" bgcolor="#FF6600" class="header1"><div align="center"><img src="http://www.intervallemedia.com/images/bannier.jpg" /></div></td>
      </tr>
      <tr>
        <td height="33" colspan="2" bgcolor="#0099CC">&nbsp;</td>
      </tr>
      <tr>
        <td height="23" colspan="2">&nbsp;</td>
      </tr>
      <tr>
        <td width="438"><table width="433" border="1">
          <tr>
            <td width="129" align="left" class="edito"><p>Ici texte <br />
                <br />
              Ici texte <br />
      <br />
      <br />
      <strong>Antoine </strong></p>
              <p><strong>Dupont</strong></p>
              <p><br />
                  <em>Webmaster@intervallemedia.com</em></p>
        <h1 class="article1">Titre du premier article </h1>
              </p>ceci est une newslettre from intervallemedia </td>
          </tr>
        </table>
        <p align="center"><a href="http://www.intervallemedia.com">Intervallemedia</a></p></td>
        <td width="190"><h2 class="breves1">ICI TITRE DE CETTE COLONNE </h2>
          <p class="breves2"> Ici texte </p>
          <h2 class="breves1">Ici titre 1 </h2>
          <p class="breves2"> Ici texte <br />
              <strong><a href="#">Lire la suite</a></strong></p>
          <h2 class="breves1">Ici titre 2 </h2>
          <p class="breves2">Ici texte</p>
          <h2 class="breves1">Ici titre 3 </h2>
        <p class="breves2">Ici texte</p></td>
      </tr>
    </table>
    </body>
    </html>
    je copie ceci dans textarea

    quand je verifier la table je vois qu'il a inserrer uniquement
    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
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Document sans nom</title>
    <style type="text/css">
    .header1 {
    background-color:#FF6600;
    background-image:url(http://www.monsite.com/img/logo.jpg);
    background-repeat:no-repeat;
    background-position:10px 10px;
    font: normal 24px Arial, Helvetica, sans-serif;
    color: #fff;
    }
    .edito {
    border: 2px solid #0099CC;
    padding:15px;
    line-height:18px;
    }
    h1.article1 {
    font: bold 13px Georgia, "Times New Roman", Times, serif;
    color:#f60;
    border-bottom: 1px solid #f60;
    margin-top:20px;
    }
    h2.breves1 {font: bold 11px Verdana, Arial, Helvetica, sans-serif;
    color:#f60;
    }
    </style>
    </head>
     
    <body>
    <table width="644" height="483" border="1">
      <tr>
        <td height="98" colspan="2" bgcolor="#FF6600" class="header1"><div align="center"><img src="http://www.intervallemedia.com/images/bannier.jpg" /></div></td>
    es ce que c'est le probleme de la taille ou type du champs ?
    si oui alors qu'elle type j'utiliserai pour qu'il supporte bcp de caractere ?
    svp aider moi ?

  2. #2
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Par défaut
    Il n'y a pas de formulaire et pas d'insertion dans le code que tu nous montres.
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  3. #3
    Membre éclairé
    Homme Profil pro
    Développeur Web
    Inscrit en
    Mars 2008
    Messages
    298
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Mars 2008
    Messages : 298
    Par défaut
    Citation Envoyé par sabotage Voir le message
    Il n'y a pas de formulaire et pas d'insertion dans le code que tu nous montres.
    ok voila
    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
    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
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Newslettre</title>
    <link rel="stylesheet" href="css/monstyle.css">
    <SCRIPT LANGUAGE="javascript" TYPE="text/javascript" SRC="control_newslettre.js"></SCRIPT>
    <style type="text/css">
    <!--
    .Style2 {font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-weight: bold;
    	color: #003575;
    	font-size: 12px;
    }
    .Style3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 10px; color: #003575; }
    -->
    </style>
    </head>
    <body onload="ajax('pied.php', 'pied'); return false">
    <div id="admin">
    <form id="form1" name="form1">
      <table width="775" border="0" align="center">
        <tr>
          <td colspan="3" bordercolor="#5679A3"><div align="center"><img src="images/emailing/haut.jpg" width="694" height="2" /></div></td>
        </tr>
        <tr>
          <td width="1" rowspan="2" bordercolor="#5679A3">&nbsp;</td>
          <td width="746" height="674"><table width="516" height="614" border="0" align="center">
            <tr>
              <td height="103" colspan="4"><img src="images/bannier.jpg" width="696" height="179" /></td>
            </tr>
            <tr>
              <td height="38" valign="bottom">&nbsp;</td>
              <td height="38" valign="bottom"> <span class="Style2">Admin</span> : <font color="#FF0000"><?php if(isset($_SESSION['pseudo']))
    		  {$logi=$_SESSION['pseudo']; 
    		  print($logi);
    		  } ?></font></td>
              <td width="435" height="38" valign="bottom">&nbsp;&nbsp;
                <div align="center">Intervallemedia.com | Bienvenue&nbsp;</div></td>
              <td width="99" valign="bottom"><a href="logout.php" onclick="ajax('logout.php', 'admin'); return false" class="Style2"> D&eacute;connexion</a></td>
            </tr>
            <tr>
              <td width="3" rowspan="6">&nbsp;</td>
              <td height="9" colspan="3"><div align="center"><span class="Style2">Newsletter destin&eacute;e a tous les abonn&eacute;s [Intervallemedia] :</span></div></td>
            </tr>
            <tr>
              <td height="10" colspan="3"><img src="images/emailing/haut.jpg" width="694" height="2" /></td>
            </tr>
            <tr>
              <td width="152" height="59"><label><br />
                    <br />
                    <span class="Style3">Titre :</span> <br />
              </label></td>
              <td colspan="2"><br />
                  <br />
                  <input name="titre" id="titre"  style="height:21px;"/>
                  <label></label>
                  <br />
                  <label></label></td>
            </tr>
            <tr>
              <td valign="top"><span class="Style3">Message:</span></td>
              <td colspan="2"><label>
                <textarea name="msg" cols="66" rows="16" id="msg"></textarea>
              </label></td>
            </tr>
            <tr>
              <td colspan="3">&nbsp;</td>
            </tr>
            <tr>
              <td height="26" colspan="2"><label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                  <table width="582" border="0">
                    <tr>
                      <td width="348"><div align="right"> &nbsp;
                        <input name="Submit222" type="button" class="button" onclick="ajax4()" value="Envoyer" />
                        &nbsp;</div></td>
                      <td width="224"><label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <input name="Submit2" type="reset" class="button" value="Effacer" />
                      </label></td>
                    </tr>
                  </table>
                <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                  <label> &nbsp;&nbsp;&nbsp;</label></td>
              <td>&nbsp;</td>
            </tr>
          </table></td>
          <td width="1" rowspan="2" bordercolor="#5679A3">&nbsp;</td>
        </tr>
     
        <tr>
          <td bordercolor="#5679A3"><div align="center"><img src="images/emailing/haut.jpg" width="694" height="2" /></div></td>
        </tr>
      </table>
    </form>
    </div>
    </body>
    </html>
    ecriture_newslettre
    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
    <?php
     
    $msg=$_POST['msg']; //message newslettre 
    $titre=$_POST['titre']; //titre newslettre
    if(!empty($titre) && !empty($msg))
    {
     
    $sql="insert into `envoi-newslettre` values('', '$titre', '$msg', 'CURRENT_TIMESTAMP')";
    $req=mysql_query($sql) or die("erreur en sql". mysql_error());
     
    ?>
    <table width="741" border="0" align="center">
      <tr>
        <td colspan="3"><div align="center" class="etat_blanc"></div></td>
      </tr>
      <tr>
        <td width="105" rowspan="4">&nbsp;</td>
        <td width="46" rowspan="4"><span class="Style4"><img src="images/ok.png" width="44" height="52" /></span></td>
        <td width="576"><p class="Style_envoi"><font face="Times New Roman, Times, serif"></p></td>
      </tr>
      <tr>
        <td>Newslettre a &eacute;t&eacute; ajouter avec suc&eacute;es </td>
      </tr>
      <tr>
        <td><div align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="index.php" onclick="ajax('admin-newslettre.php', 'admin'); return false">Retour</a></div></td>
      </tr>
      <tr>
        <td><?php print($msg); ?></td>
      </tr>
    </table>
    <?php
    }
    ?>

  4. #4
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Par défaut
    Et de quel type est ton champ actuellement ?
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  5. #5
    Membre éclairé
    Homme Profil pro
    Développeur Web
    Inscrit en
    Mars 2008
    Messages
    298
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Maroc

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Mars 2008
    Messages : 298
    Par défaut
    Citation Envoyé par sabotage Voir le message
    Et de quel type est ton champ actuellement ?
    bonne question
    bon j'ai fais type text puis j'ai finalement mis type longtext
    mais ca ne pas resolu le probleme puisque qu'il s'enregistre que la mointié d mon newslettre j'en sais pas pourquoi ?

  6. #6
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Par défaut
    As-tu controlé que tu recevais bien la chaine de caractère entière depuis ton formulaire ?
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

Discussions similaires

  1. probleme de creation une base donnée dans oracle 9i
    Par ra'uf dans le forum Débuter
    Réponses: 2
    Dernier message: 15/05/2009, 15h38
  2. [MySQL] Probleme de suppression d'une donnée dans MySql
    Par Boony dans le forum PHP & Base de données
    Réponses: 8
    Dernier message: 01/06/2008, 11h12
  3. Probleme avec l'acquisition des données dans un port dans le serveur
    Par soufian2290 dans le forum Serveurs (Apache, IIS,...)
    Réponses: 12
    Dernier message: 04/11/2007, 12h48
  4. Réponses: 2
    Dernier message: 04/12/2005, 20h07
  5. Ajouter données dans un champ (concat)
    Par TNorth dans le forum Requêtes
    Réponses: 6
    Dernier message: 09/05/2005, 21h38

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo