Note that there are some explanatory texts on larger screens.

plurals
  1. POwill this INSERT profile work with my Mysql InnoDB oriented DB?
    primarykey
    data
    text
    <p>I am wondering on the following subject (regarding INSERT on Mysql - InnoDB tables).</p> <p>I have a system that does among other system 2 things</p> <ol> <li>promote a newsletter to users</li> <li>mass emails to a certain type of users</li> </ol> <p>now, the users will grow to 4k, and supposedly to 40k</p> <p>When I'm mass emailing, I'm doing an INSERT for each user <strong>id</strong> in a WHILE (which loops through all the users).</p> <p>I have 2 questions : </p> <ol> <li>Is this the best way to do it ?</li> <li>When users reach 40K (40.000 users), will the mysql-server sustain this ?</li> </ol> <p>thanks,</p> <p><strong>this is the piece of code i'm using</strong></p> <pre><code> $query_write_mass = "SELECT id FROM mya_users ORDER by artist_real_address ASC"; $result_write_mass = $db-&gt;prepare($query_write_mass); $result_write_mass-&gt;execute(); while ( list($receiver_id) = $result_write_mass-&gt;fetch(PDO::FETCH_BOTH) ) { $stmt = $db-&gt;prepare ("INSERT INTO inbox(folder_id, sender_id, sender_type, receiver_id, receiver_type, title, message_body, time, date, flag, spam) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); $stmt-&gt;bindValue(1, 0, PDO::PARAM_INT); $stmt-&gt;bindValue(2, 0, PDO::PARAM_INT); $stmt-&gt;bindValue(3, 'x', PDO::PARAM_STR); $stmt-&gt;bindValue(4, $receiver_id, PDO::PARAM_INT); $stmt-&gt;bindValue(5, $receiver_type, PDO::PARAM_STR); $stmt-&gt;bindValue(6, $_POST['title'], PDO::PARAM_STR); $stmt-&gt;bindValue(7, $_POST['body'], PDO::PARAM_STR); $stmt-&gt;bindValue(8, date("G:i:s"), PDO::PARAM_STR); $stmt-&gt;bindValue(9, date("Y-m-d"), PDO::PARAM_STR); $stmt-&gt;bindValue(10, 'n', PDO::PARAM_STR); $stmt-&gt;bindValue(11, '', PDO::PARAM_STR); $stmt-&gt;execute(); } </code></pre> <p>This is for the mass emailing for my internal email system.</p> <p><strong>UPDATE</strong></p> <p>You can find a good answer to this question in my other post (resolved) @</p> <p><a href="https://stackoverflow.com/questions/18170365/multiple-inserts-and-keeping-pdo-prepared-statement-security">multiple INSERTS and keeping PDO prepared statement security</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload