Eviter un INSERT INTO
Résolu/Fermé
analog101
Messages postés
173
Date d'inscription
mardi 1 avril 2008
Statut
Membre
Dernière intervention
25 février 2020
-
Modifié par analog101 le 22/04/2013 à 20:18
analog101 - 24 avril 2013 à 12:48
analog101 - 24 avril 2013 à 12:48
A voir également:
- Eviter un INSERT INTO
- Touche insert - Guide
- Marques smartphone à éviter - Accueil - Guide téléphones
- Éviter pub youtube - Accueil - Streaming
- Disk boot failure insert system disk and press enter - Guide
- Touche inser sur elite book hp - Forum PC portable
5 réponses
jeremy.s
Messages postés
1226
Date d'inscription
lundi 28 mars 2011
Statut
Membre
Dernière intervention
2 septembre 2013
79
22 avril 2013 à 20:31
22 avril 2013 à 20:31
Salut !
Envois ton code en entier, on verra bien :)
Envois ton code en entier, on verra bien :)
hilflo29
Messages postés
14
Date d'inscription
lundi 22 avril 2013
Statut
Membre
Dernière intervention
4 novembre 2013
1
22 avril 2013 à 20:40
22 avril 2013 à 20:40
Mets un name="machinchose" sur l'input='submit' et tu test si machinchose est soumis avec l'insertion, si oui, il insere si non, il fait rien
analog101
Messages postés
173
Date d'inscription
mardi 1 avril 2008
Statut
Membre
Dernière intervention
25 février 2020
3
22 avril 2013 à 20:55
22 avril 2013 à 20:55
Voilà le code du fichier php. Merci!!
include_once ('header.php');
$payment_amount = floatval($_REQUEST['amountremise']);
$user_id = intval($_REQUEST['userid']);
(string) $management_box = NULL;
(string) $page_handle = 'register';
$msg_changes_saved = '<p align="center" class="contentfont">' . CHANGES_SAVED . '</p>';
$form_submitted = false;
$user = new user();
$user->setts = &$setts;
$tax = new tax();
$tax->setts = &$setts;
$invoice_name = CREDIT_VOUCHER; // Remise
$payment_gateway = 'USER_GRIP';
$sql_select_main_balance = $db->query("SELECT balance FROM " . DB_PREFIX . "users where user_id = '" . $user_id . "' LIMIT 0,1");
$old_main_solde = $db->fetch_array($sql_select_main_balance);
print_r($old_main_solde);
$main_solde = $old_main_solde['balance'] - $payment_amount;
echo 'New sold > ' . $main_solde;
$sql_insert_main_solde = $db->query("UPDATE " . DB_PREFIX . "users SET
balance='" . $main_solde . "' WHERE
user_id= " . $user_id . "");
$sql_select_balance = $db->query("SELECT * FROM " . DB_PREFIX . "remise where user_id = '" . $user_id . "' ORDER BY invoice_id DESC LIMIT 0,1");
$old_solde = $db->fetch_array($sql_select_balance);
$solde = $old_solde['current_balance'] - $payment_amount;
?>
<script>alert("INSERT INTO remise ")</script>
<?
$sql_insert_invoice = $db->query("INSERT INTO " . DB_PREFIX . "remise
(user_id, name, amount, invoice_date, current_balance, live_fee, processor, tax_calculated) VALUES
('" . $user_id . "', '" . $invoice_name . "',
'" . $payment_amount . "', '" . CURRENT_TIME . "', '" . $solde . "', '1', '" . $payment_gateway . "',
'1')");
$template_output .= $template->process('grip1user.tpl.php');
include_once ('footer.php');
echo $template_output;
include_once ('header.php');
$payment_amount = floatval($_REQUEST['amountremise']);
$user_id = intval($_REQUEST['userid']);
(string) $management_box = NULL;
(string) $page_handle = 'register';
$msg_changes_saved = '<p align="center" class="contentfont">' . CHANGES_SAVED . '</p>';
$form_submitted = false;
$user = new user();
$user->setts = &$setts;
$tax = new tax();
$tax->setts = &$setts;
$invoice_name = CREDIT_VOUCHER; // Remise
$payment_gateway = 'USER_GRIP';
$sql_select_main_balance = $db->query("SELECT balance FROM " . DB_PREFIX . "users where user_id = '" . $user_id . "' LIMIT 0,1");
$old_main_solde = $db->fetch_array($sql_select_main_balance);
print_r($old_main_solde);
$main_solde = $old_main_solde['balance'] - $payment_amount;
echo 'New sold > ' . $main_solde;
$sql_insert_main_solde = $db->query("UPDATE " . DB_PREFIX . "users SET
balance='" . $main_solde . "' WHERE
user_id= " . $user_id . "");
$sql_select_balance = $db->query("SELECT * FROM " . DB_PREFIX . "remise where user_id = '" . $user_id . "' ORDER BY invoice_id DESC LIMIT 0,1");
$old_solde = $db->fetch_array($sql_select_balance);
$solde = $old_solde['current_balance'] - $payment_amount;
?>
<script>alert("INSERT INTO remise ")</script>
<?
$sql_insert_invoice = $db->query("INSERT INTO " . DB_PREFIX . "remise
(user_id, name, amount, invoice_date, current_balance, live_fee, processor, tax_calculated) VALUES
('" . $user_id . "', '" . $invoice_name . "',
'" . $payment_amount . "', '" . CURRENT_TIME . "', '" . $solde . "', '1', '" . $payment_gateway . "',
'1')");
$template_output .= $template->process('grip1user.tpl.php');
include_once ('footer.php');
echo $template_output;
hilflo29
Messages postés
14
Date d'inscription
lundi 22 avril 2013
Statut
Membre
Dernière intervention
4 novembre 2013
1
23 avril 2013 à 11:49
23 avril 2013 à 11:49
Et le template du formulaire
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
Le voici. Merci pour votre aide !!
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="4"><img src="images/c1.gif" width="4" height="4"></td>
<td width="100%" class="ftop"><img src="images/pixel.gif" width="1" height="1"></td>
<td width="4"><img src="images/c2.gif" width="4" height="4"></td>
</tr>
</table>
<table width="100%" border="1" cellpadding="3" cellspacing="3" class="fside">
<tr>
<td colspan="4" class="c3"><img src="images/subt.gif" align="absmiddle" hspace="4" vspace="2"> <b><?=$subpage_title;?></b></td>
</tr>
<form action="grip1user.php" method="POST" name="grip1user_form">
<input type="hidden" name="do" value="display_accounting">
<input type="hidden" name="user_id" value="<?=$user_id;?>">
<tr>
<td align="center" colspan="2"><b><?=AMSG_USER_GRIP;?></b></td>
</tr>
<tr class="c2">
<td width="150" align="right"><b>
<?=MSG_ID;?>
</b></td>
<td><input type="text" name="userid" value="" id="userid"></td>
</tr>
<tr class="c2">
<td align="right"><b>
<?=AMOUNT_CREDIT;?>
</b></td>
<td><input type="text" name="amountremise" value="" id="amountremise"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="form_grip1user" value="<?=PROCEED;?>"></td>
</tr>
</form>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="4"><img src="images/c1.gif" width="4" height="4"></td>
<td width="100%" class="ftop"><img src="images/pixel.gif" width="1" height="1"></td>
<td width="4"><img src="images/c2.gif" width="4" height="4"></td>
</tr>
</table>
<table width="100%" border="1" cellpadding="3" cellspacing="3" class="fside">
<tr>
<td colspan="4" class="c3"><img src="images/subt.gif" align="absmiddle" hspace="4" vspace="2"> <b><?=$subpage_title;?></b></td>
</tr>
<form action="grip1user.php" method="POST" name="grip1user_form">
<input type="hidden" name="do" value="display_accounting">
<input type="hidden" name="user_id" value="<?=$user_id;?>">
<tr>
<td align="center" colspan="2"><b><?=AMSG_USER_GRIP;?></b></td>
</tr>
<tr class="c2">
<td width="150" align="right"><b>
<?=MSG_ID;?>
</b></td>
<td><input type="text" name="userid" value="" id="userid"></td>
</tr>
<tr class="c2">
<td align="right"><b>
<?=AMOUNT_CREDIT;?>
</b></td>
<td><input type="text" name="amountremise" value="" id="amountremise"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="form_grip1user" value="<?=PROCEED;?>"></td>
</tr>
</form>
</table>