I want to run this php script multiple times concurrently.
$db = new mysqli('localhost', 'me', 'pw', 'test');
$time = time();
$sql = " INSERT INTO test ( `test_created` ) VALUES( ". $time .") ";
$result = $db->query($sql);
I am doing this because I want to replicate a scenario in which many users submit database entries at exactly identical time up to nanosecond, which is what I mean by 'concurrent' insert.
I tried using the virtual cron scheduler of my shared hosting provider by specifying the hour and minute of execution. Then I made five identical files containing the above-mentioned codes.
However, when I look at the table entries, the inserted timestamp are not identical. Is this because mysql can't handle concurrent insert operations? If mysql can handle 'concurrent insert', is this the right way to test concurrent insert operations? If not, how should I do it for testing purposes in php environment with or without cron?