Alrite, So i have a an entry page with a form on it, that simply enters the data into the specified database. I have a player stats entry page, and there are five lines for players. However, if not all 5 players play, I want it to check if that field is empty, and if it is, i don't want it to enter it into the database. Because when i enter a game, and i leave a player field blank, all it does is enter in all 0's for that player.

Recommended Answers

All 3 Replies

Member Avatar for Zagga

Hi BTW8892,

Please post the code you have now so we can see what needs to be changed to help you.


Zagga

Sorry about that, I completely forgot to post these two links above. Here you go.

Basically i want it to check if a player_stats field is empty, and if it is empty, it won't post it in the database.

Entry Form: http://pastebin.com/wU8LTpuH
Insert Code: http://pastebin.com/Qpb105Yv

Member Avatar for rajarajan2017

Just check with

if empty($_POST['player_stats'])
   echo "Not able to update in database";
else 
  //statements to update in database
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.