busy for several hours now, to find out what i am doing wrong.
In an update sql value becomes empty??
if(ctype_digit($_POST['id'])
AND
$_SESSION['captain'] == 1
AND
$_SESSION['team'] == $_POST['id'])
{
$teamtekst = $_POST['value'];
// update text
$q = "UPDATE teams
SET
teamtekst = '".mysql_real_escape_string($teamtekst)."'
WHERE
team_id = '".$_POST['id']."'
LIMIT 1";
$exec = mysql_query($q);
if(mysql_affected_rows($exec) == 1)
echo'ok';
else
echo $q.' '.$_POST['value'];
}
else
{
echo 'Fout in gegevens? Tekst niet opgeslagen!'; // faultmessage
}
It echo’s: UPDATE teams SET teamtekst = ” WHERE team_id = ’29’ LIMIT 1 test
so test is the real value of $_POST[‘value’] but does not show up in sql statement?
thanks in advance for any help!
its not an sql error ,
$_POST['value']is not setuse
var_dump($_POST)to know what’s inside the $_POST array and check if the$_POST['value']is already set before