I added a blob area to include a picture to my MYSQL database using a php form and now i'm getting an Undefined Error Message at risk that consists of the brand new area and also the file for your area didn't get submitted, but all of the text fields were put into the database.

Here's my form:

    <form action="http://www.yeahthatrocks.com/update.php" method="post" enctype="multipart/form-data">
    Game Name:  <input name="game_name" type="text" size="25" maxlength="255" /><br></br>
    Release Date:  <input name="release_date" type="text" size="25" /><p></p>

    Cover Image: <input type="file" name="cover" id="cover"><br><br>
  <select name="game_console">
    <option value="PS3">PS3</option>
    <option value="Xbox 360">Xbox 360</option>
    <option value="Both">Both</option>

  Game Category:  
  <select name="game_category">
    <option value="Retail">Retail</option>
    <option value="PSN">PSN</option>
    <option value="Arcade">Arcade</option>
    <option value="DLC">DLC</option>

  Game Type:  
  <select name="game_type">
    <option value="Action">Action</option>
    <option value="Action RPG">Action RPG</option>
    <option value="Adventure">Adventure</option>
    <option value="Board">Board</option>
    <option value="Card">Card</option>
    <option value="Casino">Casino</option>
    <option value="Educational">Educational</option>
    <option value="Fighting">Fighting</option>
    <option value="Flight">Flight</option>
    <option value="Game Show">Game Show</option>
    <option value="Hunting">Hunting</option>
    <option value="Music">Music</option>
    <option value="Other">Other</option>
    <option value="Pinball">Pinball</option>
    <option value="Platformer">Platformer</option>
    <option value="Puzzle">Puzzle</option>
    <option value="Racing">Racing</option>
    <option value="RPG">RPG</option>
    <option value="Shooter">Shooter</option>
    <option value="Sports">Sports</option>
    <option value="Strategy">Strategy</option>
    <option value="Virtual Pet">Virtual Pet</option>


    <input name="submit" type="submit" value="upload" />

And here's the appropriate a part of update.php:

$sql="INSERT INTO games (game_name, release_date, game_category, game_type, game_console, cover)


Is there something related to the brand new area as being a binary? The file I am uploading to that particular area is 11kb.

To begin with, you have to escape all individuals $_POST variables while you place them into MySQL, educate yourself on SQL injection weaknesses and mysql_read_escape_string()

Your error has been triggered when you are placing $_POST['game_type'] and $_POST['console'] but you do not have an application area on their behalf.


Your $_POST is missing the 'cover' area as it is personal files upload, and for that reason can come through like a $_FILES variable rather, that you'll have to educate yourself on uploading files with PHP when you are completely missing this little bit of logic.

You do not have input fields for "game_category" "game_type", "game_console" ect.. so individuals don't appear in $_Publish and PHP alerts are most likely switched on (Undefined index is really a warning). And you ought to NEVER place a $_Publish right to the database, a minimum of make use of the mysql_real_escape_string function before you decide to place individuals. Educate yourself on SQL injection and you'll realise why.