Jump to content

Inserting trouble


Spectre

Recommended Posts

Hey, I've made a lovely little php slot machine script,

 

now i've made it to also send a news item to a specified ID in game should someone try to edit the bet amounts via the URL to anythign other than my amounts I allow.

 

now I know it works for one id

 

ex:

mysql_query("INSERT INTO usernews (id, user, text, time) values ('','1','<a href=view.php?id=$memberinfo[id]>$memberinfo[username]</a> attempted to deliberately change the bet in slots.php to $gbet','$time')");

 

My problem is, I want the "user" to be more than one id, so i've made an array holding the ids I would like the message to go to, but.... can't just change the above '1' to '$notifyarray' ... I need to know a way to insert multiple rows, so one for each id in $notifyarray.

 

Any help? (sorry, don't usually use much more than simple one row inserts and updates etc so kinda setback by this small dilemma)

 

Link to comment
Share on other sites

foreach($notifyarray as $temp)$query.="('','$temp','<a href=view.php?id=$memberinfo[id]>$memberinfo[username]</a> attempted to deliberately change the bet in slots.php to $gbet','$time'),";

mysql_query('INSERT INTO usernews (id, user, text, time) values '.rtrim($query,','));

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.