php - Array to string conversion, what to do? -
i'm having problems array string conversion error. it's occurring here:
<div id="pagename"> <?php echo ['select name hjemmesider']; ?> </div>
i'm trying fetch row db , display it, can't make work... have tried tons of things try , sort out, , of course researched great bit on internet.
in foreach
or while
use echo $row['your_field_name'];
you not doin right.. try this:
$sql = "select id, firstname, lastname myguests"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo "id: " . $row["id"]. " - name: " . $row["firstname"]. " " . $row["lastname"]. "<br>"; } } else { echo "0 results"; }
Comments
Post a Comment