1
Good afternoon, I’m having a doubt, I wanted to create an echo that showed all columns with a select, my code is as follows
<?php
  $db = 'localhost:F:\Dados\TGA.FDB';
  $username = 'SYSDBA';
  $password = 'masterkey';
  // Connect to database
  $dbh = ibase_connect($db, $username, $password);
  $sql = 'SELECT * FROM TMOV WHERE IDMOV = 1974';
  // Execute query
  $rc = ibase_query($dbh, $sql);
  // Get the result row by row as object
  while ($row = ibase_fetch_object($rc)) {
    echo $row -> CODCFO, "\n";
    echo $row -> NUMEROMOV, "\n";
  }
  // Release the handle associated with the result of the query
  ibase_free_result($rc);
  // Release the handle associated with the connection
  ibase_close($dbh);
 ?>         So instead of using two echo there’s some way I can use a loop he can repeat all columns like
for( new colunas; colunas < MAX_COLUNAS; i++){
  echo row[i];
 }I started programming now in php and I’m still not used to all syntax
Is that so? https://teamtreehouse.com/library/combining-strings
– tvdias