Hi,
I am not familiar with using arrays, so any guidance would be greatly appreciated on the following:
I have a table with records and each record has a groupid, userid and a statusid. Where a status is a particular number within these records, I need to gather those groupid and userid into an array (i guess!).
Then i need to use the values in the array to update the same table with a new statusid.
So, i basically need guidance on how to do this...
This is what I have so far:
$sqlquery = "SELECT groupid, userid, statusid FROM mytable WHERE statusid = 1";
$result = mysql_query($sqlquery);
while ($datarow = mysql_fetch_array($result)) {
$myarray[] = $datarow[groupid];
$myarray[] = $datarow[userid];
}
Now I need to create an update query which updates the statusid of the records where userid and groupid exist in the array.
Any advice or guidance will be greatly appareciated and i hope i make sense.
Regards.