Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/17/2022 in all areas

  1. Maybe a td tag inside the inner foreach loop instead of a tr tag?
    1 point
  2. Your cleaned up code, such as it is: <label>Title</label <input class="form-control" type="text" name="title"; <label>Аuthor</label> <input class="form-control" type="text" name="author"> <br> <div style="padding-left: 10px;"> <button type="submit" name="save">save</button> </div> <?php include 'config.php'; if(isset($_POST['save'])) { if($link->connect_error) { die('Connect failed: '.$link->connect_error); } else { $stmt = $link->prepare("insert into user_books(user_name_books, user_name_author, user_year, user_ISBAN) value(?, ?, ?, ?)"); $stmt->bind_param("ssss", $title, $author, $year, $isban); $execval = $stmt->execute(); if(!isset($title) || trim($title) == '') { echo 'You did not fill out the required fields title'; } else { if(!isset($author) || trim($author) == '') { echo " You did not fill out the required fields author"; } else { if(!isset($year) || trim($year) == '') { echo 'You did not fill out the required fields year'; } else { if(!isset($isban) || trim($isban)=='') { echo 'You did not fill out the required fields isban'; } else { header("Location: homeUserFinish.php"); } } You are showing us how you are handling the received POST data. The only thing is where do all of the fields you are editing come from since you don't show us? It seems that if you don't have any POST data you don't do any of these checks so that is one hole. And since you are asking about the 'save' process, it would be helpful if you showed us THAT code from your other script instead of this one.
    1 point
  3. OK I have sorted it. I created a function decOrNull() which returns either a decimal value or null, and changed $sale_stamp = $_POST['sale_stamp']; to $sale_stamp = decOrNull($_POST['sale_stamp']); and it works. I should have seen that myself earlier Thanks for your help anyway. Mick
    1 point
  4. I use mostly PHP Debug and PHP Intelephense.
    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.