Jump to content

Recommended Posts

Hello i have problem with this requete and i dont knwo resolved faill sql, so can you help me?

	<?php
	{
                // dans $pays on a le pays de l'offre. exemple "fr"
$pays = $tab[2];
// dans $palier on a le palier de l'offre. exemple "Plus A"
$palier = urldecode($tab[3]);
// dans $id_palier on a l'identifiant de l'offre
$id_palier = urldecode($tab[4]);
// dans $type on a le type de l'offre. exemple "sms", "audiotel, "cb", etc.
$type = urldecode($tab[5]);
// vous pouvez à tout moment consulter la liste des paliers à l'adresse : http://script.starpass.fr/palier.php
                $credit = 50;
                $id_c = $_SESSION['id'];
                $i_r = 1;
                $code = mysql_real_escape_string($_POST['code1']);
                ;
                 if (bdd('account_2014')->exec("UPDATE account SET cash = (cash+" . $credit . "), total_recharg=(total_recharg+" . $i_r . ") WHERE id = " . $id_c . " ")) {
                    echo '<br /><center><font color="lime">Votre compte vient d\'&ecirctre cr&eacutedit&eacute de 50 Or.</font>';
                    echo '<br /><a href="?p=Acceuil">Veuillez-cliquez ici si la redirection ne fonctionne pas.</a></center>';
                    bdd('log_2014')->exec("INSERT INTO rechargement(id_acc,cash_credit,pays,type,code,date) VALUES ('$id_c','$credit','$pays','$type','$code',NOW()) ");
                    echo'<meta http-equiv="refresh" content="4;url=?p=Choix" />';
                }
}elseif (isset($_POST['DATAS']) && substr($tab[0],0,3) != "OUI") {
    echo '<br /><center><font color="red">Le code que vous venez de rentrer n\'est pas valide. Si ce code est pourtant valide, veuillez contacter un membre du staff avec le code utilisé.</font>';
    echo '<br /><a href="?p=Acceuil">Veuillez-cliquez ici si la redirection ne fonctionne pas.</a></center>';
}
	} else {
            ?>
	
Link to comment
Share on other sites

Hello, thank you for your quick response, first of all how I made to go from mysql mysqli? that sounds very complicated. There could not be simpler? I use PDO for my website. Finally, I add this piece of code is when the script?

I tried this method, but the entered code is not saved in the database, in place in the database, there have: code

	if (bdd('account_2014')->exec("UPDATE account SET cash = (cash+" . $credit . "), total_recharg=(total_recharg+" . $i_r . ") WHERE id = " . $id_c . " ")) {
                    echo '<br /><center><font color="lime">Votre compte vient d\'&ecirctre cr&eacutedit&eacute de 50 Or.</font>';
                    echo '<br /><a href="?p=Acceuil">Veuillez-cliquez ici si la redirection ne fonctionne pas.</a></center>';
                    $pdo = bdd('log_2014')->prepare("INSERT INTO rechargement(id_acc,
                                                                       cash_credit,
                                                                       pays,
                                                                       type,
                                                                       code,
                                                                       date) VALUES (
                                                                       '$id_c',
                                                                       '$credit',
                                                                       '$pays',
                                                                       '$type',
                                                                       ':code',
                                                                       NOW()) ");
                                $pdo->bindParam(':code', $code, PDO::PARAM_STR);
                                $pdo->execute();
	

Link to comment
Share on other sites

  • Bronze

The PDO error code 00000 means that everything works fine. The reason you're hitting the error-checking code is that $pdo is returning 0 (no rows were effected), so the query seems fine and you have a logical problem in your query if you ask me.

 

OR you have past errorInfo() on the wrong place.

  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 0

      Moving server from FreeBSD 11.2 to 13.2 - lib needed

    2. 0

      I just implemented some costumes and they are not visible

    3. 0

      Skill Tree Problem

    4. 97

      Ulthar SF V2 (TMP4 Base)

    5. 5

      Client Crashes through Offline Shop (Ikarus)

    6. 5

      VIVY-WORLD2 - FARM TO THE TOP

    7. 0

      ToolTip Bug?

    8. 0

      Skill tree build erorr

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.