Hello, help solve the problem gives this error when starting the page:
Undefined index: id_topic in C:\wamp64\www\forum1\view_topic.php on line 42 Although this name is in the table and I want to take its id and display its value by the given id. Here is the code located on 42 lines:
$id = $_GET['id_topic']; $sql = "SELECT * FROM $tbl_name WHERE id_topic='$id'"; $result = mysqli_query($con, $sql) or die(mysqli_error()); if ($rows = mysqli_fetch_array($result)) { //значения из таблицы через $rows } I use php7 and help me figure it out. Mysql table:
CREATE TABLE `forum_question` ( `id_topic` int(31) NOT NULL, `topic` varchar(255) NOT NULL, `detail` longtext NOT NULL, `name` varchar(255) NOT NULL, `email` varchar(31) NOT NULL, `date` varchar(31) NOT NULL, `view` int(31) NOT NULL, `reply` int(31) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8;