1

I'm beginner for php and I'm coding on Notepad_++. an error creating in my programming while updating/editing any row from the table. When I changed something from the row and click on submit button then page return on main page and nothing changed with without error shown, show I can't guess where is error. suppose..- I have a table which name is Customer Details_tbl and I click on a row edit button, after click a page opening which name is add_customer_tbl and I trying to change some information of customer, after some changing,' I clicking on submit button and page return on Customer_detail_tbl page but no changing and no any error showing .. so my question is how to fix it..

$error="Failed to Update.". mysqli_error($db); //this code I already putted 
Zain Farooq
  • 2,956
  • 3
  • 20
  • 42
  • If you are redirected after the error occurs, you lose the error message. The code you've written above (reading from `mysqli_error`) might be alright, but you should remove the redirect first – Nico Haase Aug 02 '18 at 06:07
  • 1
    Instead of explaining your code, you should add all the relevant code into the question. We need to see the context of the above line. – M. Eriksson Aug 02 '18 at 06:11
  • . when I was searching not founded any ans. related to this q. okay.. so dnt say It Duplicate ..plzzz – PRASHANT DUBEY Aug 02 '18 at 11:10

3 Answers3

5

If you want to view Error then you can do many ways:

1.) You can do it from PHP.INI

display_errors = on

2.) You can do it from error_reporting(1);

<?php
// Turn off error reporting
error_reporting(1);

// Report runtime errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);

// Report all errors
error_reporting(E_ALL);

// Same as error_reporting(E_ALL);
ini_set("error_reporting", E_ALL);

// Report all errors except E_NOTICE
error_reporting(E_ALL & ~E_NOTICE);
?

3.) You can do it from ini_set('display_errors', 1);

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

Set this in index.php

kiran malvi
  • 1,058
  • 10
  • 21
1

first You should modify your php.ini with this line:

display_errors = on

and you can also Dumping Variables Before Send to db For debug

var_dump($yourvar);
die();
Mahdi Mirhendi
  • 363
  • 1
  • 4
  • 14
-1

Use it after declare php tag or show me your full code for clarification :

ini_set('display_errors', 1);
eisbehr
  • 12,243
  • 7
  • 38
  • 63