How to view MYSQL data in Value within input

Asked

Viewed 187 times

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?

  • 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

  • Do you want a text to be displayed for each movie or all in the same text? I still don’t understand this.

  • 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

  • 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.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.