vendredi 24 mars 2017

How to insert in MySQL at the same second

I am trying to insert a row into mysql at the same second, I have a simple for loop which inserts date into mysql.

This for loop takes 12 seconds because it has to loop 12 times. And my MySQL Database shows each row at different second.

I want to insert multiple rows at the same second, I know I might not get all of the 12 rows at the same time but want to see how many rows can be inserted to my database via my function at the same time.

Here is my function.

    $ddos=new DDOSManager();
    //This is my library/class.
    echo 'Start: '. date('H:m:s',time()).'<br>';
    for($i=0;$i<12;$i++){
        //In this function the data is being inserted to the database, via Laravel Eloquent.
        $ddos->TrackDOS($data);
    }
    return date('H:m:s',time());



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2ocFLQj
via IFTTT

Aucun commentaire:

Enregistrer un commentaire