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

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -