php - view sql data into html -


i'm trying view information sql db inside html page, doesn't work. code shows no results @ all.

<?php      $host        = "drhatem-pc";               $user        = "sa";                      $pass        = "23635451";                  $db          = "dr_hatem_clinic";        @$connect = odbc_connect("driver={sql server};server={".$host."}; database={".$db."}", "".$user."", "".$pass."") or die("<center><b style=\"border:1px dashed #ff0000;\">".str_replace("[microsoft][odbc sql server driver][sql server]", "", odbc_errormsg())."</b></center>");      $row = odbc_fetch_array(odbc_exec($connect, "select * entrance")); ?> <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html4/strict.dtd"> <html>     <head>         <table style="border:1px solid #3f3f3f; border-radius: 8px 8px 8px 8px;padding: 4px;background-color:rgba(50,50,50,0.55);text-align:center;color: #fff;font-weight: bold; font-family: arial, helvetica, sans-serif;font-size:12px;" width="100%" cellpadding="0" cellspacing="0">              <tr>                  <td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);">id</td>                  <td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);">attend time</td>                  <td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);">visit reason</td>                  <td style="border:1px solid #3f3f3f;background:rgba(0,0,0,0.55);">name</td>              </tr>              <tr>                 <td style="border:1px solid #3f3f3f;"><?php $row['id']; ?></td>                  <td style="border:1px solid #3f3f3f;"><?php $row['date']; ?></td>                  <td style="border:1px solid #3f3f3f;"><?php $row['vist_type']; ?></td>                      <td style="border:1px solid #3f3f3f;"><?php $row['fullname']; ?></td>             </tr>         </table>     </head> </html> 

1) loop each row 2) echo rows. have <?php $row['...']; ?> nothing.

$qry = odbc_exec($connect, "select * entrance"); while ($row = odbc_fetch_array($qry)) { ...  html php:  echo $row['my key']; ... } 

Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -