sperophp Posted January 9, 2014 Share Posted January 9, 2014 @move_uploaded_file( $upload_Temp , $uploadFile); chmod($uploadFile, 0644); $upload_URL = "uploads/".$upload_Name ; $uploadFile = "uploads/".$upload_Name ; $id=$_POST['id']; $name=$_POST['name']; $upload_Name=($_FILES['FILE']['name']); //Writes the information to the database mysql_connect("localhost", "freak_admin", "what") or die(mysql_error()); mysql_select_db("freak_doc") or die(mysql_error()); mysql_query("INSERT INTO `users_cv` VALUES ('$id', '$name', '$upload_Name')"); Hello Good Php Gurus! i have tried to find my way around this but no show.from the php admin everything works fine including the name of the file visible. the above code works when i view the info on my view.php(the field for name shows) however the field for upload_name is blank because the idea I had isnt working below <td> echo "<a href=" ./ $upload_URL . basename($row_users['file']) . "> {$row_users['upload_Name']}</a>";</td> Can someone help me with what i am doing wrong? thanks newbie Quote Link to comment https://forums.phpfreaks.com/topic/285226-html-output-to-view-file-on-server-linked-to-a-database/ Share on other sites More sharing options...
BuildMyWeb Posted January 14, 2014 Share Posted January 14, 2014 i dont really understand your question but at first glance, you are assigning $upload_Name in line 7, but you refer to it in line 3 $upload_URL = "uploads/".$upload_Name ; ... ... $upload_Name=($_FILES['FILE']['name']); fyi, youd prolly get better help in a different forum. this is not an HTML question Quote Link to comment https://forums.phpfreaks.com/topic/285226-html-output-to-view-file-on-server-linked-to-a-database/#findComment-1465219 Share on other sites More sharing options...
cyberRobot Posted January 15, 2014 Share Posted January 15, 2014 Moving to PHP Coding Help forum. Quote Link to comment https://forums.phpfreaks.com/topic/285226-html-output-to-view-file-on-server-linked-to-a-database/#findComment-1465338 Share on other sites More sharing options...
KaiSheng Posted January 16, 2014 Share Posted January 16, 2014 Do not really understand where you coming from. But this line seems weird to me. mysql_query("INSERT INTO `users_cv` VALUES ('$id', '$name', '$upload_Name')"); isn't it be like mysql_query("INSERT INTO `users_cv` (id,name,upload_Name) VALUES ('$id', '$name', '$upload_Name')"); ?? Quote Link to comment https://forums.phpfreaks.com/topic/285226-html-output-to-view-file-on-server-linked-to-a-database/#findComment-1465374 Share on other sites More sharing options...
Barand Posted January 16, 2014 Share Posted January 16, 2014 If the VALUES provides a value for every column in the table in the correct order then there is no need to specify the column names. However, as you suggest, it is better to do so. If the table is subsequently altered the the query will fail if the columns are not specified. Quote Link to comment https://forums.phpfreaks.com/topic/285226-html-output-to-view-file-on-server-linked-to-a-database/#findComment-1465396 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.