Erreur SQL

Fermé
Fushiida - 17 janv. 2012 à 23:34
 netbookette - 17 janv. 2012 à 23:44
Bonjour,





Alors voila, j'ai une erreur sql parrait t'il a la ligne 116, voici mon code

	<p>Payment</p>
	</div>
    <div id="middle_con">
<style type="text/javascript">

</style>
<style type="text/css">
div#container
{
   width: 770px;
   position: relative;
   margin-top: 0px;
   margin-left: auto;
   margin-right: auto;
   text-align: left;
}
</style>
<style type="text/css">
</style>
<script type="text/javascript">
<!--

</script>
<style type="text/css">
h6
{
   font-family: Arial;
   font-size: 16px;
   font-weight: normal;
   font-style: normal;
   text-decoration: none;
   color: #000000;
   margin: 0 0 0 0;
   padding: 0 0 0 0;
   display: inline;
}

a.style1:link
{
   color: #666666;
   text-decoration: none;
}
a.style1:visited
{
   color: #000000;
   text-decoration: none;
}
a.style1:active
{
   color: #000000;
   text-decoration: none;
}
a.style1:hover
{
   color: #282828;
   text-decoration: none;
}
</style>
</head>
<form method="post">
<div id="container">
<div id="wb_Image1" style="position:absolute;left:0px;top:0px;width:737px;height:325px;z-index:0;" align="left">
<img src="images/bg.png" id="Image1" alt="" align="top" border="0" style="width:737px;height:325px;"></div>
<div id="wb_Image2" style="position:absolute;left:43px;top:38px;width:442px;height:247px;z-index:1;" align="left">
<img src="images/bg.png" id="Image2" alt="" align="top" border="0" style="width:442px;height:247px;"></div>
<div id="wb_Text2" style="position:absolute;left:150px;top:97px;width:85px;height:19px;z-index:2;" align="left">
<font style="font-size:16px" color="#666666" face="Candara">Pseudo ID : </font></div>
<div id="wb_Text1" style="position:absolute;left:116px;top:127px;width:126px;height:19px;z-index:3;" align="left">
<font style="font-size:16px" color="#666666" face="Candara">Paysafecard PIN :</font></div>
<div id="wb_Text4" style="position:absolute;left:109px;top:184px;width:126px;height:38px;z-index:4;" align="left">
<font style="font-size:16px" color="#666666" face="Candara">Paysafecard PW* :</font></div>
<div id="wb_Text3" style="position:absolute;left:179px;top:155px;width:59px;height:19px;z-index:5;" align="left">
<font style="font-size:16px" color="#666666" face="Candara">Betrag :</font></div>
<div id="wb_Text5" style="position:absolute;left:513px;top:76px;width:37px;height:38px;z-index:6;" align="left">
<font style="font-size:16px" color="#666666" face="Candara">Euro:</font></div>
<div id="wb_Text6" style="position:absolute;left:590px;top:76px;width:45px;height:19px;z-index:7;" align="left">
<font style="font-size:16px" color="#666666" face="Candara">Coins:</font></div>
<div id="wb_Text7" style="position:absolute;left:521px;top:113px;width:116px;height:19px;z-index:8;" align="left">
<font style="font-size:16px" color="#666666" face="Candara">10€&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 2500</font></div>
<div id="wb_Text8" style="position:absolute;left:520px;top:139px;width:113px;height:19px;z-index:9;" align="left">
<font style="font-size:16px" color="#666666" face="Candara">25€&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 7500</font></div>
<div id="wb_Text9" style="position:absolute;left:518px;top:171px;width:125px;height:19px;z-index:10;" align="left">
<font style="font-size:16px" color="#666666" face="Candara">50€&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 15000</font></div>
<div id="wb_Text10" style="position:absolute;left:517px;top:203px;width:132px;height:19px;z-index:11;" align="left">
<font style="font-size:16px" color="#666666" face="Candara">100€&nbsp;&nbsp;&nbsp;&nbsp; -&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 30000</font></div>
<div id="wb_Text11" style="position:absolute;left:520px;top:240px;width:128px;height:14px;z-index:12;" align="left">
<font style="font-size:12px" color="#666666" face="candara">*Seulement si disponible.</font></div>
<input type="text" id="Editbox6" class="Heading 6 <h6>" style="position:absolute;left:242px;top:98px;width:129px;height:20px;z-index:13" name="accid" value="">
<input type="text" id="Editbox2" class="Heading 6 <h6>" style="position:absolute;left:242px;top:127px;width:32px;height:20px;z-index:14" name="pscnr1" value="" maxlength="4">
<input type="text" id="Editbox1" class="Heading 6 <h6>" style="position:absolute;left:282px;top:127px;width:32px;height:20px;z-index:15" name="pscnr2" value="" maxlength="4">
<input type="text" id="Editbox4" class="Heading 6 <h6>" style="position:absolute;left:323px;top:127px;width:32px;height:20px;z-index:16" name="pscnr3" value="" maxlength="4">
<input type="text" id="Editbox3" class="Heading 6 <h6>" style="position:absolute;left:364px;top:127px;width:32px;height:20px;z-index:17" name="pscnr4" value="" maxlength="4">
<select name="wert" size="1" id="Combobox2" class="Heading 6 <h6>" style="position:absolute;left:242px;top:157px;width:84px;height:20px;z-index:18">
<option>10 Euro</option>
<option>25 Euro</option>
<option>50 Euro</option>
<option>100 Euro</option>
</select>
<input type="text" id="Editbox5" class="Heading 6 <h6>" style="position:absolute;left:242px;top:185px;width:129px;height:20px;z-index:19" name="pscpw" value="">
<input type="submit" id="psc" name="psc" value="Cash-In" style="position:absolute;left:148px;top:217px;width:96px;height:25px;font-family:Arial;font-size:13px;z-index:20">
<input type="reset" id="Button1" name="" value="Zurücksetzen" style="position:absolute;left:255px;top:217px;width:96px;height:25px;font-family:Arial;font-size:13px;z-index:21">
</div>





<?php
if($_POST['psc'])
{
	
	include('conf.php');
	mysql_select_db('account');
	$pscnr = $_POST['pscnr1'].'-'.$_POST['pscnr2'].'-'.$_POST['pscnr3'].'-'.$_POST['pscnr4'];
	$id = mysql_real_escape_string($_POST['id']);
	$psc = mysql_real_escape_string($pscnr);
	$pscpw = mysql_real_escape_string($_POST['passwort']);
	$wert = mysql_real_escape_string($_POST['wert']);
		
		$sql = "INSERT into psc set account_id = '$id' , psc = '$psc' , pw = '$pscpw' , wert = '$wert'";
		$ergebnis = mysql_query($sql);
		 if($ergebnis)
			{
			$sql2 = "SELECT * from psc where account_id = '$id' and psc = '$psc' and pscpw = '$pscpw' , wert = '$wert'";
			$ergebnis2 = mysql_query($sql2);
			//$num = mysql_num_rows($ergebnis2);
//			javascript:alert('Ihr Auftrag wurde gespeichert.'); 
			echo "<script>alert(\"Votre commande a été enregistrée. Il peut prendre jusqu'à 12 heures jusqu'à ce que les pièces sont là.\");</script>";
			}
			else
			{
//			javascript:alert('Die Speicherung der Kartennummer ist fehlgeschlagen.'); 
			echo "<script>alert(\"Le stockage du numéro de carte a échoué.\");</script>";
			}
}

?>



Je ne voit pas ou je me suis tromper
Je vous remercie d'avance pour les reponces

2 réponses

SlyK Messages postés 854 Date d'inscription vendredi 11 mars 2011 Statut Contributeur sécurité Dernière intervention 6 octobre 2014 147
17 janv. 2012 à 23:36
Bonsoir,

C'est possible d'indiqué qu'elle est l'erreur SQL, et de montrer la ligne 116 ?


Cordialement.
0
t'as une page toute blanche avec marqué "erreur sql"? ou t'as quelque chose de plus qui s'affiche sur ta page?
c'est quoi le message qui s'affiche exactement?

Si j'étais toi, je vérifierai si la connexion à la base de données se fait bien (c'est dans le code du fichier conf.php je suppose mais il n'est pas dans les codes que tu nous a donné. Si ca c'est bon je mettrai en commentaire ton code php et je décommenterai ligne après ligne ou paragraphe après paragraphe pour voir quelle ligne précisément fait planter
0