I have a form where the user inserts data inside mysql table and I display that data into another webpage of my website. Specifically,it's directions. I want the directions to display as an ordered html list.Example:
1) Do this.
2) Do this too.
Instead of: 1) Do this. 2) Do this too.
When the data is submited, I manually write html code inside so it appears the way I want. Which is something wrong, I think. Isn't there any other way to achieve this?
This is the php code that interacts with the html form:
$stmt = $mysqli->prepare("INSERT INTO table (something, something, something, method) VALUES (?, ?, ?, ?)");
$stmt->bind_param("ssss", $_POST['something'], $_POST['something'], $_POST['something'], $_POST['method']);
$stmt->execute();
$stmt->close();
echo 'Congratulations!';
This is the php code that I use to display the content to the other web page.
$stmt = $mysqli->prepare("SELECT something, something, method FROM table WHERE id = ?");
$stmt->bind_param("i", $id);
$stmt->execute();
$stmt->store_result();
if($stmt->num_rows === 0) exit('Nothing exists here.');
$stmt->bind_result($something, $something, $method);
$stmt->fetch();
echo "$method";
I want whatever is written inside Method textarea to appear as list,like the example above. Thank you!