need some mysql help, on two codes, that is
Moderator: General Moderators
need some mysql help, on two codes, that is
These mysql querys: UPDATE and DELETE dont work
http://users.skynet.be/fa321669/edit_news.txt
http://users.skynet.be/fa321669/delete_news.txt
http://users.skynet.be/fa321669/edit_news.txt
http://users.skynet.be/fa321669/delete_news.txt
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
the DELETE query should work, it does in phpmyadmin... so its prolly a php isue
the EDIT query gives me SQL-query: in phpmyadmin.. but doesnt change anything
the EDIT query gives me SQL-query:
Code: Select all
UPDATE news SET text ='test', author ='test1', email ='test2'', title ='test1' WHERE ID = 1-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
Code: Select all
$news_id = $_GET['id'];
$query = "D.ELETE FROM news WHERE ID = '" . $news_id ."'";is what i now have, but it still isnt working
Code: Select all
$news_id = mysql_escape_string($_GET['news_id']);
$query = "D.ELETE FROM news WHERE id='$news_id'";-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
and i assume that there is a table called 'news' in lower case and that has a field called 'ID' in upper case and that the $news_id variable references a valid field in that table.
If that is still is all correct still, then do you have permission to use the DELETE statment? i.e. does the username you use to log into the mySQL server have that command in user table?
If that is still is all correct still, then do you have permission to use the DELETE statment? i.e. does the username you use to log into the mySQL server have that command in user table?
Code: Select all
use mysql;
SELECT Delete_priv FROM user WHERE User = 'My User Name';- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England