Sounds a bit stoopid :? But can somebody help me fast?
Moderator: General Moderators
Sounds a bit stoopid :? But can somebody help me fast?
My syntax is this, but it still doesn't update the empty table colum
$Opdracht = "Update $Table SET ID=$ID, Naam=$Naam, AchterNM=$AchterNM, WNPlaats=$WNPlaats, Post=$Post, Straat=$Straat, Studie=$Studie, Email=$Email, Username=$Username, Password=$Password, Blok=$Blok, WHERE ID=$ID";
$Opdracht = "Update $Table SET ID=$ID, Naam=$Naam, AchterNM=$AchterNM, WNPlaats=$WNPlaats, Post=$Post, Straat=$Straat, Studie=$Studie, Email=$Email, Username=$Username, Password=$Password, Blok=$Blok, WHERE ID=$ID";
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
You probably need single quotes around all of those strings that you are trying to enter and no comma before the WHERE clause:
Mac
Code: Select all
$Opdracht = "Update $Table SET ID='$ID', Naam='$Naam', AchterNM='$AchterNM', WNPlaats='$WNPlaats', Post='$Post', Straat='$Straat', Studie='$Studie', Email='$Email', Username='$Username', Password='$Password', Blok='$Blok' WHERE ID='$ID'";It still doesn't work Don't forget that the Blok Table Colum is empty in the first place.
As you can see herehttp://members.chello.nl/~s.vandemeulen/test.jpg
As you can see herehttp://members.chello.nl/~s.vandemeulen/test.jpg
i'm not sure if i understand you but here goes...
you cannot update an empty table.
remove comma before WHERE
If there a $id value in your table?
Other than that, I just learned a thing from you. That's a very short way of doing things. I would have done it this way.
'UPDATE tablename SET id=' . $id . ', naam=' . $naam . ' WHERE id=' . $id;
you cannot update an empty table.
remove comma before WHERE
If there a $id value in your table?
Other than that, I just learned a thing from you. That's a very short way of doing things. I would have done it this way.
'UPDATE tablename SET id=' . $id . ', naam=' . $naam . ' WHERE id=' . $id;
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Have you tried echoing out the query to make sure that all the variables are being passed to it correctly? Have you tried running the query in phpMyAdmin? (Obviously replacing the variables, $ID, $blok etc with actual data). You are putting the statement through a mysql_query() call aren't you?
Mac
Code: Select all
mysql_query($Opdracht) or die(mysql_error().'<p>'.$Opdracht.'</p>');Yes that is correct first it makes a query on the page and on that page ther is a link that must be able to send al the qeury information of just one row with an uniec number (ID)
To Blockuser.php and in that source coed stands that The row with this ID has to be updated The update must be don in the colm BLOK in to ther has to come the word YES So that the blok colm is not enymore empty and contains the word yes
So the user has still his account, but it contains the word yes in blok and when Blok is Yes, the user can not continue with login because he is blocked.
Maybe that is more clear. But maybe I should fill in for al the Blok Colms A NO in the first place so I can update it to a YES?
Maybe that will work? What do you guys think?
Greathings Skywalker
To Blockuser.php and in that source coed stands that The row with this ID has to be updated The update must be don in the colm BLOK in to ther has to come the word YES So that the blok colm is not enymore empty and contains the word yes
So the user has still his account, but it contains the word yes in blok and when Blok is Yes, the user can not continue with login because he is blocked.
Maybe that is more clear. But maybe I should fill in for al the Blok Colms A NO in the first place so I can update it to a YES?
Maybe that will work? What do you guys think?
Greathings Skywalker
The colum can be empty. If you want to update just one colum you may do this:
Code: Select all
$Opdracht = "Update $Table SET Blok='$Blok' WHERE ID=$ID";- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK