我正在尝试从我的数据库中收集随机数量的成员,获取他们的 ID 号并使用它们将多个条目插入到另一个表中,这些条目使用 ID 和来自同一页面的一些发布信息。
当前(非工作)代码:
if($_POST["Submit"] == "Send Mail") {
$rid = $_SESSION["userid"];
//is amount of members sending to
$to = $_POST["credits"];
$messaging = $_POST["message"];
$sub = $_POST["subject"];
///need all ids for amount of membes sending to
$getodds = mysql_query("select Id from `oto_members` ORDER BY RAND() Limit '$to';");
...
///insert a new line for each member sending to using ids from $getodds query
@mysql_query("INSERT INTO `mp_creditmail` (`Id`, `message`, `subject`, `read`) VALUES ('$values', '$messaging', '$sub', no) or die(mysql_error());
}