INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Since Upgrade to PHP 5.6 new data Rows will inserted multiple instead of once

Since Upgrade to PHP 5.6 new data Rows will inserted multiple instead of once

Since Upgrade to PHP 5.6 new data Rows will inserted multiple instead of once

(OP)
Hi there

We have a problem
In our old environment (PHP5.1, 5.3 with MySQL) we do have used this code
Always the new player was oinserted if not exist once
Now this code hase two issues we not have seen before :
1.) The player was inserted - but the tips will be NOT saved
2.) The player is inserte as many times as it has an entry in the file (up to three times - which is maximum)

CODE -->

while (!feof($fd)) {
    $zeile=fgetss($fd,4096);
    if (strstr($zeile,"back to top")) {
        $land=split("(ft | :)",$zeile);
    } else {
        if (strstr($zeile,"|")) {
            $i++;
            preg_match($tipPattern, $zeile, $m);

            $rpos = $m[1] == '---' ? '' : $m[1];
            $rname = trim($m[2]);
            $rnat = $land[1];
            if ($m[5] == 'Keine Auswahl') {
                $rgeg = '';
            } else {
                $tmp = explode('gegen ', $m[5]);
                if (count($tmp) > 0) {
                    $rgeg = $tmp[1];
                } else {
                    $rgeg = $m[5];
                }
            }
            $rspiel = $m[4];
            $rtip = $m[3];
            $rspielt = 0;

            $nat_id = $teams[$rnat];
            $geg_id = $teams[$rgeg];

            if (isset ($players[$rname])) {
                $player_id = $players[$rname];
            } else {
                $s = "INSERT INTO tm_nm_players (player_name) VALUES ('$rname')";
                mysqli_query ($db_connection,$s);
                $player_id = mysqli_insert_id ();
                $players[$rname] = $player_id;
            } 

All other rows will be read and insert with (directly next line in code) :

CODE -->

$sql="INSERT INTO tm_nm_tips (saison,woche,player_id,team_id,vsteam_id,spiel_get,tip,pos,spielt) ";
                        $sql.="VALUES ('$saison_id','$woche_id',$player_id,'$nat_id','$geg_id','$rspiel','$rtip','$rpos','$rspielt')";
                        //print $sql;
                        mysqli_query($db_connection,$sql);
        }
    }
} 
correctly. Only Players which are new will be only inserted in first table, but tipps are not stored. Next time when user is existing it will be store all Tipps correctly
What can be the difference between older PHP and 5.6 in case of this behaviour ?
thanks in advance
Uwe

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close