A
A
Alexander2014-12-06 17:51:05
PHP
Alexander, 2014-12-06 17:51:05

How to display all values ​​of a column from access php?

I try to do so

$conn_lom = odbc_connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=$patch_lom", '', '');
$table_lom="SELECT * FROM teh";
$run_lom=odbc_exec($conn_lom,$table_lom);

 if (!$run_lom)
  {exit("Error in SQL");}

  while (odbc_fetch_row($run_lom))
  {
  $id=odbc_result($run_lom,"id");
  $Kr=odbc_result($run_lom,"Kr");
  }
  
echo $id;
echo $Kr;
odbc_close($conn_lom);

in this way, only 1 value of each column is displayed ...
but you need to display everything, for the subsequent sending of all data to mysql
upd. everything worked out,
but is it possible without adding a cycle? I just think it would be wrong to shove there more and this
@mysql_connect("$address", "$user", "$password");
@mysql_select_db("$base_mysql");
$query = "INSERT INTO $table(id, Kr)
VALUES('$id', '$Kr')";
mysql_query($query);
mysql_close();

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2014-12-06
@unix0

Add echo to the body of the loop

while (odbc_fetch_row($run_lom))
  {
    $id=odbc_result($run_lom,"id");
    $Kr=odbc_result($run_lom,"Kr");
    echo $id;
    echo $Kr;
  }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question