<?php include 'connection.php'; ?>
<?php
if (isset($_GET['consultation']))
{
echo "Consultation Details";
$no=$_GET['consultation'];
?>
<form class="" method="get">
<textarea name="details" rows="8" cols="80" placeholder="enter consultation details"></textarea><br>
<button type="submit" name="c">submit</button>
</form>
<?php
if (isset($_GET['details'])) {
$details=$_GET['details'];
}
//$details= $_GET['details'];
$insertQuery="INSERT INTO redo (consultation) VALUES ($details) WHERE no=$no;";
$insert = mysqli_query($conn,$insertQuery);
if ($insert) {
echo "recorded";
?>
<a href="display.php">Back to Total Patients</a>
<a href="index.php">Back to Registration</a>
<?php
}
else {
echo "record couldnt be inserted";
}
}
?>
Asked
Active
Viewed 1,096 times
-2

Dharman
- 30,962
- 25
- 85
- 135

rangerboyy
- 185
- 2
- 10
-
Format your code and write some description – Chilarai Jul 26 '20 at 03:11
-
Please construct a bit better your question, at least precise on which row you have a problem. – iguypouf Jul 26 '20 at 07:52
1 Answers
-1
No $_GET['details']
, you sure you're using a GET
method in the form? Change $_GET['details']
to $_REQUEST['details']
.
To be exact, this one fails:
if (isset($_GET['details'])) {
$details=$_GET['details'];
}
I mean, the if
condition is not met, so $details
is not defined, as you don't define it anywhere in the code outside that if
.
Other solution would be adding:
$details = '';
in front of that if
.

Flash Thunder
- 11,672
- 8
- 47
- 91