Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
why isn't this working..
Old 05-26-2006, 02:23 PM why isn't this working..
Experienced Talker

Posts: 41
Trades: 0
so yeah this used to work for me before

it deleted the name from the database and the folder..but now i tryed to use it with another code and is not work..

i changed it in the right places i made this code before and it works but i tried everythign i know and nothing works.. can someone see something i'm not seen?

PHP Code:
if(isset($_POST['Delete'])){
$dir="albums/";
$pic=$picturedes['fotoname'];
$dir='userpic/'.$pic;
unlink($dir);
$co="DELETE FROM tra_photo WHERE fotoname='$pic'";
$cod=mysql_query($co)or die(mysql_error()); if($co){
echo 
'picture deleted!';
}else{
echo 
'could not delete...';
}

richard181 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-26-2006, 10:04 PM Re: why isn't this working..
Experienced Talker

Posts: 31
Trades: 0
where is $picturedes[]; coming from?
.:origin:. is offline
Reply With Quote
View Public Profile
 
Old 05-27-2006, 06:44 AM Re: why isn't this working..
cdwhalley.com's Avatar
Skilled Talker

Posts: 75
Trades: 0
PHP Code:
if(isset($_POST['Delete'])){
$dir="albums/";//<- what is this for?
$pic=$picturedes['fotoname'];//<- where has this come from?
$dir='userpic/'.$pic;//<- what is this for?
unlink($dir);
$co="DELETE FROM tra_photo WHERE fotoname='$pic'";
$cod=mysql_query($co)or die(mysql_error());
if(
$cod){//<- should be $cod instead of $co
echo 'picture deleted!';
}else{
echo 
'could not delete...';
}

Plenty of questions for you there
But origin's is the most important.
cdwhalley.com is offline
Reply With Quote
View Public Profile Visit cdwhalley.com's homepage!
 
Old 05-27-2006, 02:44 PM Re: why isn't this working..
ChancesAre's Avatar
Skilled Talker

Posts: 84
Trades: 0
Quote:
Originally Posted by richard181
so yeah this used to work for me before

it deleted the name from the database and the folder..but now i tryed to use it with another code and is not work..

i changed it in the right places i made this code before and it works but i tried everythign i know and nothing works.. can someone see something i'm not seen?

PHP Code:
if(isset($_POST['Delete'])){
$dir="albums/";
$pic=$picturedes['fotoname'];
$dir='userpic/'.$pic;
unlink($dir);
$co="DELETE FROM tra_photo WHERE fotoname='$pic'";
$cod=mysql_query($co)or die(mysql_error()); if($co){ 
echo 
'picture deleted!';
}else{
echo 
'could not delete...';
}

Looking at the code i think you have a wrong variable in your argument there, check out the underlined code.

if($co){ <-- Should be if($cod){
ChancesAre is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to why isn't this working..
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13002 seconds with 12 queries