Hi all
I have some problem with my code there is no errors with my code its for a game swelect list for user whos logged in to display wat games they like
what i have is a list menu which is called product[]
In my Actual PHP Code
its only doingPHP Code:if(isset($_POST['setgames']))
{
$product=$_POST['product'];
if($product || $User)
{
//query to insert into cutomer
foreach($product as $prod)
{
$oQuery="update members set gamesplayed='".$prod."' WHERE username='".$_SESSION['user']."'";
echo $oQuery;
$res2=$con->query($oQuery);
if(!$res2)
{
echo "<br/><br/>Error Cannot Set Games Played Because ".mysqli_error($con);
}
}
}
}
update members set gamesplayed='Starcraft:Orginal' WHERE
username='Admin'
update members set gamesplayed='Starcraft:Brood' WHERE username='Admin'
update members set gamesplayed='Diablo2' WHERE username='Admin'
update members set gamesplayed='Diablo2:Lod' WHERE username='Admin'
update members set gamesplayed='Warcraft' WHERE username='Admin'
When its meant to be game 1,game2,game3,game4 not when they select more than one
in the database for the field gamesplayed is varchar of 255
What am i doing wrong
can anyone help?








Bookmarks