Bonjour,
J'ai fais une liaison sur ma base oracle via ODBC : tout ok
Mais lorsque je fais afficher la liste de mes enregistrements dans un tableau, il me manque systematiquement le 1er enregistrement.
Partie requete
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 $conn=odbc_connect('xxx','yyy','zzz'); if ( !$conn) { echo "Erreur connect" ; die; } if ($conn) { $sql = sprintf("select info1,info2 from table where code=%s order by %s",$code,$code); $result = odbc_exec($conn,$sql); $row=odbc_fetch_row($result); $num_row=0; }
Partie tableau
Pouvez-vous me dire ou je fais l'erreur?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 <table class="contenu"> <tr> <td> </td> <td> </td> </tr> <tr> <td>Info1</td> <td>Info2</td> </tr> <?php while ($row=odbc_fetch_row($result)) { $info1= odbc_result($result, 1); $info2= odbc_result($result, 2); ?> <tr> <td><?php echo $info1; ?></td> <td><?php echo $info2; ?></td> </tr> <?php $num_row=$num_row + 1;} ?> </table> <?php odbc_free_result($result); odbc_close($conn); ?>
Par avance merci
Partager