By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,064 Members | 1,388 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,064 IT Pros & Developers. It's quick & easy.

Why is this code won't work

P: 16
Expand|Select|Wrap|Line Numbers
  1. $itarget = "images/";
  2.                             $ftarget = "files/";
  3.                             $idir = $itarget.$image['name'];
  4.                             $fdir = $ftarget.$file['name'];
  5.                             $gquery = "INSERT INTO `games` VALUES ('','".$name."','".$content."','".$idir."','".$fdir."','','')";
  6.                             if(mysql_query($gquery)){
  7.                                 $itarget = $itarget.basename($image['name']);
  8.                                 $ftarget = $ftarget.basename($file['name']);
  9.                                 if((move_uploaded_file($image['tmp_name'],$itarget))&&move_uploaded_file($file['tmp_name'],$ftarget)){
  10.                                     echo '<h1>Success!</h1>';
  11.                                 }else{
  12.                                     echo 'sorry';    
  13.                                 }
  14.                             }else{
  15.                                 echo '0';    
  16.                             }
  17.  
Mar 4 '12 #1
Share this Question
Share on Google+
2 Replies


PsychoCoder
Expert Mod 100+
P: 465
What is it doing versus what you're wanting it to do. Simply saying "it wont work" makes it very difficult to help find a solution.
Mar 4 '12 #2

P: 16
I found the problem it was with the phpmyadmin table
Mar 4 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.