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 :

Enregistrement automatique de champs


Sujet :

PHP & Base de données

  1. #1
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Avril 2013
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2013
    Messages : 7
    Points : 1
    Points
    1
    Par défaut Enregistrement automatique de champs
    Bonjour a toutes et tous,

    Voici ma question,

    J'ai une formule de type "if" dans le bas de ma page php qui me donne un résultat, et je voudrai que ce resultat s'enregistre dans ma base de donnée.

    j'ai essayer plusieurs fois avec la fonction inser to mais cela me donne des erreur.

    Faut il alors mettre cette fonction dans ma page d'insertion de formulaire ??

    Comment faut il faire ??


    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
    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
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    <?php
     
     
    // Connexion à la base de donnée
    mysql_connect("localhost", "xxxx", "xxxxxx");
    mysql_select_db('xxxx');
     
     
    // Le nom de notre table
    $tablename = 'personnes';
     
     
    // Tri sur colonne
    $tri_autorises = array('date', 'client','ndecde','montant','pose','sm','fournisseur','allegro','livprevue','livconfirmee','statut');
    $order_by = in_array($_GET['order'],$tri_autorises) ? $_GET['order'] : 'date'; 'client';'ndecde';'montant';'pose';'sm';'fournisseur';'allegro';'livprevue';'livconfirmee';'statut';
     
     
    // Sens du tri
    $order_dir = isset($_GET['inverse']) ? 'DESC' : 'ASC';
     
     
    // Préparation de la requête
    $sql = "
            SELECT *
            FROM {$tablename}
            ORDER BY {$order_by} {$order_dir}
    ";
    $result = mysql_query($sql);
     
     
    // Notre fonction qui affiche les liens
    function sort_link($text, $order=false)
    {
            global $order_by, $order_dir;
     
            if(!$order)
                    $order = $text;
     
            $link = '<a href="?order=' . $order;
            if($order_by==$order && $order_dir=='ASC')
                    $link .= '&inverse=true';
            $link .= '"';
            if($order_by==$order && $order_dir=='ASC')
                    $link .= ' class="order_asc"';
            elseif($order_by==$order && $order_dir=='DESC')
                    $link .= ' class="order_desc"';
            $link .= '>' . $text . '</a>';
     
            return $link;
    }
     
     
    // Affichage
    ?>
    <style type="text/css">
    a.order_asc,
    a.order_desc:hover { 
            padding-right:15px;
            background:transparent url(s_asc.png) right no-repeat;
    }
    a.order_desc,
    a.order_asc:hover {
            padding-right:15px;
            background:transparent url(s_desc.png) right no-repeat;
    }
    </style>
     
    <table width="100%" border="1">
     
            <tr>
     
            <th><?php echo sort_link('DATE', 'date') ?></th>
            <th><?php echo sort_link('CLIENT', 'client') ?></th>
            <th><?php echo sort_link('N° DE CDE', 'ndecde') ?></th>
            <th><?php echo sort_link('MONTANT', 'montant') ?></th>
            <th><?php echo sort_link('POSE', 'pose') ?></th>
            <th><?php echo sort_link('S/M', 'sm') ?></th>
            <th><?php echo sort_link('FOURNISSEUR', 'fournisseur') ?></th>
            <th><?php echo sort_link('ALLEGRO', 'allegro') ?></th>
            <th><?php echo sort_link('LIVRAISON PREVUE', 'livprevue') ?></th>
            <th><?php echo sort_link('LIVRAISON CONFIRMEE', 'livconfirmee') ?></th>
            <th><?php echo sort_link('COMMENTAIRES', 'commentaires') ?></th>
            <th><?php echo sort_link('STATUT', 'statut') ?></th>
            <th><?php echo sort_link('ETAT', '-') ?></th>
     
     
    </th> 
            </tr>
     
     
     
    <?php while( $row=mysql_fetch_assoc($result) ) : ?>
     
     
    <tr>
     
    <?php    
    switch ($row['statut']){ 
    case 'EN COURS': 
    $couleur='orange';//a remplacer par le code hexa de la couleur voulue #....... 
    break; 
     
    case 'LIVRABLE': 
    $couleur='green';//a remplacer par le code hexa de la couleur voulue #....... 
    break; 
     
    case 'SOLDEE': 
    $couleur='gray';//a remplacer par le code hexa de la couleur voulue #....... 
    break; 
     
    case 'RETARD': 
    $couleur='red';//a remplacer par le code hexa de la couleur voulue #....... 
    break; 
     
    default: 
    $couleur= 'white';//a remplacer par le code hexa de la couleur par defaut 
    break; 
     
    } 
    echo "<tr style=\"background-color:$couleur;\"> 
    
    <td width=\"100\">"; 
    echo $row['date']; 
    echo "</td> 
    
    <td width=\"150\">"; 
    echo $row['client']; 
    echo "</td> 
    
    <td width=\"100\">"; 
    echo $row['ndecde']; 
    echo "</td> 
    
    <td width=\"100\">"; 
    echo $row['montant']; 
    echo "</td> 
    
    <td width=\"150\">"; 
    echo $row['pose']; 
    echo "</td> 
    
    <td width=\"50\">"; 
    echo $row['sm']; 
    echo "</td> 
    
    <td width=\"250\">"; 
    echo $row['fournisseur']; 
    echo "</td> 
    
    <td width=\"100\">"; 
    echo $row['allegro']; 
    echo "</td> 
    
    <td width=\"100\">"; 
    echo $row['livprevue']; 
    echo "</td> 
    
    <td width=\"100\">"; 
    echo $row['livconfirmee']; 
    echo "</td> 
    
    <td width=\"150\">"; 
    echo $row['commentaires']; 
    echo "</td> 
    
    <td width=\"100\">"; 
    echo $row['statut']; 
    echo "</td> 
    
      
    
    <td width=\"200\">"; 
     
    // Voici ma formule :   
     
    $madate=$row['livprevue'];
    $madate1=$row['livconfirmee'];
    $madate=explode("-",$madate);
    $madate1=explode("-",$madate1);
    $madate=mktime(0,0,0,$madate[1],$madate[2],$madate[0]);
    $madate1=mktime(0,0,0,$madate1[1],$madate1[2],$madate1[0]);
    $dateAujourdhui  = mktime(0, 0, 0, date("m"),   date("d"),   date("Y"));
     
    if($madate<$dateAujourdhui&&$row['statut']='SOLDEE'){
        echo "<span style='color:black;'>SOLDEE</span>";
     
    }elseif($madate1>$dateAujourdhui){
            echo "<span style='color:green;'>EN PRODUCTION</span>"; 
     
    }elseif($madate==$dateAujourdhui&&$row['statut']=='SOLDEE'){
        echo "<span style='color:black;'>SOLDEE</span>";
     
    }elseif($madate==$dateAujourdhui&&$row['statut']=='LIVRABLE'){
        echo "<span style='color:white;'>LIVRABLE</span>";
     
    }elseif($madate<$dateAujourdhui&&$row['statut']=='LIVRABLE'){
        echo "<span style='color:white;'>LIVRABLE</span>";  
     
    }elseif($madate==$dateAujourdhui){
            echo "<span style='color:blue;'>DERNIER JOUR</span>";
     
    }elseif($madate<$dateAujourdhui){
            echo "<span style='color:red;'>EN RETARD</span>";
     
    }elseif($madate>$dateAujourdhui&&$row['statut']=='LIVRABLE'){
        echo "<span style='color:white;'>LIVRABLE</span>";          
     
    }else{
        echo "<span style='color:black;'>EN COURS</span>";
    }
     
     
    ?>               
    </tr>
     
    <?php endwhile ?>
    </table>

    Merci

  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
    Points : 44 155
    Points
    44 155
    Par défaut
    Il faudrait nous montrer ta requête et nous dire quelles erreurs tu as.

  3. #3
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Avril 2013
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2013
    Messages : 7
    Points : 1
    Points
    1
    Par défaut
    J'ai ajouter un "insert to" juste avant la fonction if a partir de la ligne 173, mais rien ne s'enregistre.

    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
    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
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    <?php
     
     
    // Connexion à la base de donnée
    mysql_connect("localhost", "xxxxx", "xxxxxx");
    mysql_select_db('xxxxx');
     
     
    // Le nom de notre table
    $tablename = 'pose';
     
     
    // Tri sur colonne
    $tri_autorises = array('date', 'client','forfait','numero','rtpayer','retourtheoriquert','retourreelrt','envoidevis','statut','commande',);
    $order_by = in_array($_GET['order'],$tri_autorises) ? $_GET['order'] : 'date'; 'client';'forfait';'dispoproduits';'rtpayer';'retourtheoriquert';'retourreelrt';'envoidevis';'statut';'commande';
     
     
    // Sens du tri
    $order_dir = isset($_GET['inverse']) ? 'DESC' : 'ASC';
     
     
    // Préparation de la requête
    $sql = "
    	SELECT *
    	FROM {$tablename}
    	ORDER BY {$order_by} {$order_dir}
    ";
    $result = mysql_query($sql);
     
     
    // Notre fonction qui affiche les liens
    function sort_link($text, $order=false)
    {
    	global $order_by, $order_dir;
     
    	if(!$order)
    		$order = $text;
     
    	$link = '<a href="?order=' . $order;
    	if($order_by==$order && $order_dir=='ASC')
    		$link .= '&inverse=true';
    	$link .= '"';
    	if($order_by==$order && $order_dir=='ASC')
    		$link .= ' class="order_asc"';
    	elseif($order_by==$order && $order_dir=='DESC')
    		$link .= ' class="order_desc"';
    	$link .= '>' . $text . '</a>';
     
    	return $link;
    }
     
     
    // Affichage
    ?>
    <style type="text/css">
    a.order_asc,
    a.order_desc:hover { 
    	padding-right:15px;
    	background:transparent url(s_asc.png) right no-repeat;
    }
    a.order_desc,
    a.order_asc:hover {
    	padding-right:15px;
    	background:transparent url(s_desc.png) right no-repeat;
    }
    </style>
     
    <table width="100%" border="1">
     
    	<tr>
     
    		<th><?php echo sort_link('DATE', 'date') ?></th>
    		<th><?php echo sort_link('CLIENT', 'client') ?></th>
            <th><?php echo sort_link('FORFAIT', 'forfait') ?></th>
            <th><?php echo sort_link('NUMERO DOSSIER', 'numero') ?></th>
            <th><?php echo sort_link('RT PAYER', 'rtpayer') ?></th>
            <th><?php echo sort_link('RETOUR THEORIQUE RT', 'retourtheoriquert') ?></th>
            <th><?php echo sort_link('RETOUR REEL RT', 'retourreelrt') ?></th>
            <th><?php echo sort_link('ENVOIS DEVIS', 'envoidevis') ?></th>
            <th><?php echo sort_link('COMMANDE', 'commande') ?></th>
    		<th><?php echo sort_link('STATUT', 'statut') ?></th>
            <th><?php echo sort_link('ETAT', '-') ?></th>
     
     
    </th> 
    	</tr>
     
     
     
    <?php while( $row=mysql_fetch_assoc($result) ) : ?>
     
     
    <tr>
     
     
    <?php   
     
    switch ($row['statut']){ 
    case 'EN COURS': 
    $couleur='orange';//a remplacer par le code hexa de la couleur voulue #....... 
    break; 
     
    case 'TRAITE': 
    $couleur='green';//a remplacer par le code hexa de la couleur voulue #....... 
    break; 
     
    case 'SOLDEE': 
    $couleur='grey';//a remplacer par le code hexa de la couleur voulue #....... 
    break; 
     
    case 'RECU': 
    $couleur='green';//a remplacer par le code hexa de la couleur voulue #....... 
    break; 
     
    case 'EN COMMANDE': 
    $couleur='yellow';//a remplacer par le code hexa de la couleur voulue #....... 
    break;
     
    default: 
    $couleur= 'white';//a remplacer par le code hexa de la couleur par defaut 
    break; 
     
    } 
    echo "<tr style=\"background-color:$couleur;\"> 
    
    <td width=\"100\">"; 
    echo $row['date']; 
    echo "</td> 
    
    <td width=\"150\">"; 
    echo $row['client']; 
    echo "</td> 
    
    <td width=\"200\">"; 
    echo $row['forfait']; 
    echo "</td> 
    
    <td width=\"150\">"; 
    echo $row['numero']; 
    echo "</td> 
    
    <td width=\"50\">"; 
    echo $row['rtpayer']; 
    echo "</td> 
    
    <td width=\"100\">"; 
    echo $row['retourtheoriquert']; 
    echo "</td> 
    
    <td width=\"100\">"; 
    echo $row['retourreelrt']; 
    echo "</td> 
    
    <td width=\"100\">"; 
    echo $row['envoidevis']; 
    echo "</td> 
    
    
    <td width=\"100\">"; 
    echo $row['commande']; 
    echo "</td> 
    
    <td width=\"100\">"; 
    echo $row['statut']; 
    echo "</td> 
    
    <td width=\"100\">"; 
    echo $row['etat']; 
    echo "</td> 
    
    <td width=\"150\">"; 
     
    // on se connecte à notre base
    $base = mysql_connect ('xxxxx', 'xxxxx', 'xxxxx');
    mysql_select_db ('xxxxx') ;
     
    // lancement de la requete
    $sql = "INSERT INTO pose (etat)
           VALUES ( '$etat')";
     
    $madate=$row['retourtheoriquert'];
    $madate=explode("-",$madate);
    $madate=mktime(0,0,0,$madate[1],$madate[2],$madate[0]);
    $dateAujourdhui  = mktime(0, 0, 0, date("m"),   date("d"),   date("Y"));
     
    if($madate<$dateAujourdhui&&$row['statut']=='TRAITE'){
        echo "<span style='color:black;'>DEVIS ENVOYE AU CLIENT</span>";
     
    }elseif($madate==$dateAujourdhui&&$row['statut']=='TRAITE'){
        echo "<span style='color:black;'>DEVIS ENVOYE AU CLIENT</span>";
     
    }elseif($madate==$dateAujourdhui&&$row['statut']=='RECU'){
        echo "<span style='color:yellow;'>EN COURS DE TRAITEMENT</span>";
     
    }elseif($madate<$dateAujourdhui&&$row['statut']=='RECU'){
        echo "<span style='color:yellow;'>EN COURS DE TRAITEMENT</span>";	
     
    }elseif($madate==$dateAujourdhui&&$row['statut']=='EN COMMANDE'){
        echo "<span style='color:black;'>ATTENTE PRODUIT</span>";
     
    }elseif($madate<$dateAujourdhui&&$row['statut']=='EN COMMANDE'){
        echo "<span style='color:black;'>ATTENTE PRODUIT</span>";	
     
    }elseif($row['statut']=='SOLDEE'){
        echo "<span style='color:black;'>SOLDEE</span>";		
     
    }elseif($madate==$dateAujourdhui){
    	echo "<span style='color:blue;'>DERNIER JOUR</span>";
     
    }elseif($madate<$dateAujourdhui){
    	echo "<span style='color:red;'>RETARD</span>";
     
    }else{
        echo "<span style='color:black;'>EN COURS</span>";
    }
     
    ?>		 
    <?php
    // on se connecte à notre base
    $base = mysql_connect ('localhost', 'cash01', 'ssnbmuq');
    mysql_select_db ('cash01_INFOS') ;
     
    // lancement de la requete
    $sql = "INSERT INTO pose (etat)
           VALUES ( '$etat')";
    ?>
    </tr>
     
    <?php endwhile ?>
    </table>

  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
    Points : 44 155
    Points
    44 155
    Par défaut
    $etat n'est pas défini dans ton code.

  5. #5
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Avril 2013
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2013
    Messages : 7
    Points : 1
    Points
    1
    Par défaut
    J'ai essayé de le placer avant ma fonction if avec cette syntaxe :

    $etat =

    mais il m'indique une erreur.

  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
    Points : 44 155
    Points
    44 155
    Par défaut
    Si tu ne mets rien à droite du = c'est sur qu'il y a un soucis

  7. #7
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Avril 2013
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2013
    Messages : 7
    Points : 1
    Points
    1
    Par défaut
    cela est sur.
    mais je vais posé une question débile : je mets quoi car la je seche

  8. #8
    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
    Points : 44 155
    Points
    44 155
    Par défaut
    J'ai comme l'impression que ce code n'est pas de toi

    Résumons :
    - tu as une table "pose" qui contient des informations (date, client, commande, etat etc).
    - ta page php lit les informations dans cette table et les affiche dans un tableau.

    A partir de la qu'est ce que tu veux faire ?

  9. #9
    Expert éminent
    Avatar de Séb.
    Profil pro
    Inscrit en
    Mars 2005
    Messages
    5 238
    Détails du profil
    Informations personnelles :
    Âge : 46
    Localisation : France

    Informations professionnelles :
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Mars 2005
    Messages : 5 238
    Points : 8 502
    Points
    8 502
    Billets dans le blog
    17
    Par défaut
    Citation Envoyé par cash01 Voir le message
    cela est sur.
    mais je vais posé une question débile : je mets quoi
    La valeur que tu veux insérer dans ta bdd.

  10. #10
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Avril 2013
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2013
    Messages : 7
    Points : 1
    Points
    1
    Par défaut
    Citation Envoyé par Séb. Voir le message
    La valeur que tu veux insérer dans ta bdd.
    La valeur que je veux insérer est le résultat de la formule "if"

  11. #11
    Expert éminent
    Avatar de Séb.
    Profil pro
    Inscrit en
    Mars 2005
    Messages
    5 238
    Détails du profil
    Informations personnelles :
    Âge : 46
    Localisation : France

    Informations professionnelles :
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Mars 2005
    Messages : 5 238
    Points : 8 502
    Points
    8 502
    Billets dans le blog
    17
    Par défaut
    Citation Envoyé par cash01 Voir le message
    La valeur que je veux insérer est le résultat de la formule "if"
    if n'est pas une formule, c'est une instruction conditionnelle.

    Il faut faire :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    if ( condition ) {
        ...
        $etat = 'une valeur' ;
        ...
    } elseif ( autre condition ) {
        ...
        $etat = 'une valeur' ;
        ...
    } ...
     
    traiter $etat
    ...

  12. #12
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Avril 2013
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2013
    Messages : 7
    Points : 1
    Points
    1
    Par défaut
    Citation Envoyé par sabotage Voir le message
    J'ai comme l'impression que ce code n'est pas de toi

    Résumons :
    - tu as une table "pose" qui contient des informations (date, client, commande, etat etc).
    - ta page php lit les informations dans cette table et les affiche dans un tableau.

    A partir de la qu'est ce que tu veux faire ?
    Ce que je veut faire, (c'est peut être pas possible c'est pour cela que je demande), le resultat de la formule "if" s'affiche simplement sur ma page et moi je veut qu'il s'enregistre dans ma base de données afin de l'exploité dans des exportations PDF.

  13. #13
    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
    Points : 44 155
    Points
    44 155
    Par défaut
    Ce n'est pas la bonne façon de faire : ton état (SOLDEE, ATTENTE PRODUIT etc.) est dépendant de la date du jour ; l'information que tu stockerais aujourd'hui ne serait peut être donc plus bonne demain.

    Si tu as besoin de cet état dans ton PDF, il faut le déterminer avec des conditions comme tu le fais déjà.

  14. #14
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Avril 2013
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2013
    Messages : 7
    Points : 1
    Points
    1
    Par défaut
    Donc cela n'est pas faisable

    Je n'est plus qu'a trouver une autre solution !!!

    Merci a tous de vos réponses.

  15. #15
    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
    Points : 44 155
    Points
    44 155
    Par défaut
    La solution tu l'as déjà comme je te l'ai dit.

Discussions similaires

  1. Réponses: 4
    Dernier message: 06/08/2010, 16h52
  2. [RAVE] Enregistrer automatiquement un rapport
    Par Cryonie dans le forum Bases de données
    Réponses: 8
    Dernier message: 11/10/2005, 12h01
  3. incrémenter automatiquement un champ d'un dbgrid
    Par bertrand_declerck dans le forum Bases de données
    Réponses: 8
    Dernier message: 01/09/2005, 08h42
  4. Exécuter une requete enregistrée dans un champ
    Par pascalT dans le forum MS SQL Server
    Réponses: 10
    Dernier message: 10/03/2005, 10h46
  5. Réponses: 4
    Dernier message: 29/09/2004, 16h08

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