Re: FN-FORUM: PHP/MYsql Issue
date posted 4th January 2005 19:15
What error are you getting?
I suggest that you try inserting:
print_r($arrGenres);
after:
$arrGenres=$_POST['selstyles'];
to check that you're actually getting an array - I expect the error is
saying that it's not an array.
Maybe include some error handling anyway, is_array() for example.
Regards,
Joe.
On 4 Jan 2005 20:13:42 -0000, Gavin Cotton [EMAIL REMOVED] wrote:
>
> OK now it's this page that isn't working:
>
> $sesmemid=$HTTP_SESSION_VARS['memberid'];
> $sestype=$HTTP_SESSION_VARS['type'];
> $delallSQL="DELETE FROM membersstyles WHERE memberid = $sesmemid";
> mysql_query($delallSQL);
>
> $arrGenres=$_POST['selstyles'];
> foreach ($arrGenres as $key=>$value) {
> $strSQL="INSERT INTO membersstyles (memberid, selstyles, memtype) VALUES
> ($sesmemid, $value, $sestype)";
> mysql_query($strSQL);
> }
> header("Location: http://www.n-e-a.co.uk/memberdj/profilesystem.php");
>
> the last page posts to this one, this deletes all the entrries from the
> table for that member and then reinserts the new values they've
> selected, again works on my testing server but no on my host.....