Answer the question
In order to leave comments, you need to log in
How to display a row from the database by the specified parameter?
It is necessary to display a row from the database with a specific id, which must be set on the page in a text field. I know how to display a pre-specified id. Help improve the code.
<?php
$sql = mysqli_query($link, 'SELECT `ID`, `st_form` FROM `q6m0n_qf3_ps` WHERE st_user=103');
while ($result = mysqli_fetch_array($sql)) {
echo "{$result['st_form']}";
}
?>
Answer the question
In order to leave comments, you need to log in
If the request is http://site.ru/script.php?user=103, then:
<?php
$sql = mysqli_query($link, 'SELECT `ID`, `st_form` FROM `q6m0n_qf3_ps` WHERE st_user="'.mysqli_real_escape_string($link, $_REQUEST['user']).'"');
while ($result = mysqli_fetch_array($sql)) {
echo "{$result['st_form']}";
}
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question