Can you help me decode de code?

    $sql = "INSERT INTO videos ( memberid, whenuploaded, filename )
    VALUES( {$_SESSION["memberid"]}, NOW(), $newfilename )";

I’m confused. I have seen code that used ambiguous non-desriptive naming for tables, fields, variables, and functions, but the example you posted seems very easy to understand to me. What precisely is it that you don’t understand?

What does it say?

It is the instruction to insert the value of {$_SESSION[“memberid”]} into the membered column, the value of NOW() into the whenuploaded column and the value of $newfilename into the filename column of the table called videos in a database. When the code is called in a MySQL command.

Thank you for that explanation.
The table called ‘videos’ doesn’t have a member id column, nor do I see a ‘whenuploaded’ column, nor a ‘filename’ column.

The code is intended to store an image url/path into the database. I’ve added a column there named ‘thumbnail’.
So, based on what you explained, it seems that maybe their is no need for ‘whenuploaded’ ? and maybe I should replace ‘filename’ (in the code) with ‘thumbnail’ ?
Any additional guidance will be appreciated.

The table should contain columns for all the data you need it to store, what it stores is up to you.
If there are columns for data you don’t want, need or use, remove them. If you need more columns for stuff, add them.
When your table is as you want it, edit the sql query to suit, recording the data you want it to record.
You may want to know who uploaded and when, or maybe you don’t care about this info. Again, it’s up to you. Make the script do what you want.

Your table must have those columns or there will be an error. I assume you are using some code you have found and are altering it for your use?

You could change your code to:
$sql = “INSERT INTO videos ( filename ) VALUES( $thumbnail )”;

What column names do you have in the table now and what columns do you want?

Thank you. I tried this:

    if ($form_submitted == 'yes') {
$allowedExts = array("gif", "jpeg", "jpg", "png");
$temp = explode(".", $_FILES["file"]["name"]);
$extension = strtolower( end($temp) ); // in case user named file ".JPG" etc.!!!
if (  $_FILES["file"]["size"] < 200000
      && in_array($extension, $allowedExts) )
    if ($_FILES["file"]["error"] != 0)
        echo "Return Code: " . $_FILES["file"]["error"] . "<br>";

    } else {
        $length = 20;
        $randomString = substr(str_shuffle(md5(time())),0,$length);
        $thumbnail = $randomString . "." . $extension;
        move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $thumbnail);
        $sql = "INSERT INTO videos ( filename ) VALUES( $thumbnail )";
       $file_location = '<a href="' . $thumbnail . '">' . $thumbnail . '</a>';
} else {
  echo "Invalid upload file";
$description = $description . " \n " . $newfilename;

Along with this:

<label for="file">Filename:</label>
<input type="file" name="file" id="file">

But I still can’t seem to get the image into the thumbnail column. Any additional help will be appreciated.

You need to supply more information on the database design and any errors.

The thumbnail data may be to large for the column; the column may only accept numeric data and you are now trying to insert a string etc.

the column ‘thumbnail’ is VARCHAR 255

this should give a T_ENCAPSED_AND_WHITESPACE error.

It really sounds to me like you’re creating a gigantic mess. Typically when you inherit a project and things don’t work as expected like table columns not existing that is a problem in regards to how you set-up the project initially on your local. I would go back through and try to figure out what went wrong during initial set-up to prevent the table(s) from being properly structured. It is likely that other things failed as well that you’re just no seeing problems for yet. You really need to answer the question of why the table columns don’t exist before proceeding any further imo cause that smells like a huge issue with set-up.