Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/21/2021 in all areas

  1. You've fixed things but you haven't fixed things. Like these: if(isset($_POST['d_name'])){ } if(isset($_POST['manner_death'])){ } if(isset($_POST['place_death'])){ } if(isset($_POST['nok'])){ } if(isset($_POST['rel_nok'])){ } if(isset($_POST['morgue_att'])){ } What are those doing? Nothing. They don't do anything. Then you have if(isset($_POST['tag_num'])){ if(isset($_POST['treatment'])) The first line makes sense, but the second? Without a pair of { } then it will only run the very first line of code that comes after: the assignment for $d_name. Then in your query, $query = "insert into data ( d_name, manner_death, place_death ,nok, rel_nok, morgue_att, tag_num, treatment) values ( '$d_name'.'$manner_death','$place_death','$nok','$rel_nok','$morgue_att','$tag_num','$treatment')"; you managed to fix the one syntax error but you created a new one. You cannot create websites by putting code in your editor and hoping everything will work. You have to make actual, conscious, deliberate decisions about the code. You have to know what different pieces of code mean. You have to understand why code is what it is and then how you can use it to accomplish what you want. So before you try to write more code, stop and take a few days to learn what you can about PHP. Then come back to this file and put some thought into each line of code in it.
    2 points
  2. If you do want to replace null values with, say, '' (an empty string), then you could do this (usng my above array)... $myarr = array_map('denullify', $myarr); function denullify($v) { return $v ?? ''; }
    1 point
This leaderboard is set to New York/GMT-04:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.