0
This is my PHP code:
$result = mysqli_query($conn, "SELECT * FROM config WHERE id IN (1,2,3)");
$sdda = mysqli_fetch_assoc($result);
This is the HTML:
<div class="col-sm-12 col-lg-6">
<div class="form-group">
<label>About Text:</label> <i class="fa fa-info-circle" data-toggle="tooltip" title="Player About Text"></i>
<input type="text" name="filmes" class="form-control" value="<?php echo $sdda['id(x)'];; ?>">
</div>
</div>
I would like to know how I can display the data of only one id, such as id = 2 in value
, someone could help me?
We didn’t miss a
echo
there? And the problem is not very clear. If you only need the value for id 2, why do you select ids 1 and 3?– Woss
pardon the question yes, but I would like to display the data that are in the table, but only the one of each id, the code is all in html, I made a reference in html in php
– LeandroFalasca 1
Do you want a text to be displayed for each movie or all in the same text? I still don’t understand this.
– adrianosmateus
almost that, in the table has 2 columns, id and config, I would like it to be required as for example id 2 and height config, I would like to display it in the box
– LeandroFalasca 1
Leandro, to access an array position you have to use an integer between the brackets, so $array[3]. if id(x) is a method, it has to return an integer or something that can be an integer. If you have an id() method, please share.
– cpll