need some mysql help, on two codes, that is

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

User avatar
Diod
Forum Commoner
Posts: 52
Joined: Tue Oct 19, 2004 9:07 am

Post by Diod »

yep, i am the root user.. as i run the db on my own comp :)
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

can you post the whole block of code in which you have your delete statement? Right now you delete statement seems correct.
User avatar
Diod
Forum Commoner
Posts: 52
Joined: Tue Oct 19, 2004 9:07 am

Post by Diod »

User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

can you echo $_GET['id'] right before you use it in your delete query and see if it matches the row you're trying to delete?
( and you really should use mysql_escape_string( $_GET['id'] ) )
User avatar
Diod
Forum Commoner
Posts: 52
Joined: Tue Oct 19, 2004 9:07 am

Post by Diod »

yep, it echos it(oh and the query does work in phpmyadmin if you are gonna ask that)
User avatar
Diod
Forum Commoner
Posts: 52
Joined: Tue Oct 19, 2004 9:07 am

Post by Diod »

hmm
but when i do

Code: Select all

$query = "DELET.E FROM news WHERE id='".$news_id."'";
echo $query;
it doesnt echo
User avatar
Diod
Forum Commoner
Posts: 52
Joined: Tue Oct 19, 2004 9:07 am

Post by Diod »

Please, can anyone help me with this... im trying to figure it out for a week now...
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

Diod wrote:hmm
but when i do

Code: Select all

$query = "DELET.E FROM news WHERE id='".$news_id."'";
echo $query;
it doesnt echo
then something is seriously wrong.
do you have error_reporting turned on?
User avatar
Diod
Forum Commoner
Posts: 52
Joined: Tue Oct 19, 2004 9:07 am

Post by Diod »

yep i tryed it with error_reporting('E_ALL') and it doesnt report a thing
User avatar
Diod
Forum Commoner
Posts: 52
Joined: Tue Oct 19, 2004 9:07 am

Post by Diod »

nm someone helped me out
Post Reply