Fix: Warning mysql

This commit is contained in:
Laurent Destailleur 2006-04-28 23:54:33 +00:00
parent ad4c4e7acd
commit 28e3e859e4

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -137,11 +137,11 @@ if ($_GET["action"] == 'create')
print '<br>'; print '<br>';
print_titre('Services/Produits'); print_titre('Services/Produits');
print '<table class="noborder" width="100%">';
/* /*
* Lignes de factures * Lignes de factures
* *
*/ */
print '<table class="noborder" width="100%">';
print '<tr><td colspan="3">'; print '<tr><td colspan="3">';
$sql = "SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_taux, l.remise_percent, l.subprice"; $sql = "SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_taux, l.remise_percent, l.subprice";
@ -150,7 +150,7 @@ if ($_GET["action"] == 'create')
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
{ {
$num = $db->num_rows(); $num = $db->num_rows($result);
$i = 0; $total = 0; $i = 0; $total = 0;
echo '<table class="notopnoleftnoright" width="100%">'; echo '<table class="notopnoleftnoright" width="100%">';
@ -168,7 +168,7 @@ if ($_GET["action"] == 'create')
$var=True; $var=True;
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object(); $objp = $db->fetch_object($result);
if ($objp->fk_product > 0) if ($objp->fk_product > 0)
{ {
@ -214,7 +214,7 @@ if ($_GET["action"] == 'create')
$i++; $i++;
} }
$db->free(); $db->free($result);
} }
else else
@ -424,7 +424,7 @@ else
} }
if ($result) if ($result)
{ {
$num = $db->num_rows(); $num = $db->num_rows($result);
print_barre_liste($langs->trans("Bills"),$page,"fiche-rec.php","&socidp=$socidp",$sortfield,$sortorder,'',$num); print_barre_liste($langs->trans("Bills"),$page,"fiche-rec.php","&socidp=$socidp",$sortfield,$sortorder,'',$num);
$i = 0; $i = 0;
@ -441,7 +441,7 @@ else
$var=True; $var=True;
while ($i < min($num,$limit)) while ($i < min($num,$limit))
{ {
$objp = $db->fetch_object(); $objp = $db->fetch_object($result);
$var=!$var; $var=!$var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
@ -486,5 +486,5 @@ else
$db->close(); $db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>"); llxFooter('$Date$ - $Revision$');
?> ?>