[Weberp-svn] SF.net SVN: weberp:[8398] trunk/Customers.php
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2011-12-26 15:55:40
|
Revision: 8398 http://weberp.svn.sourceforge.net/weberp/?rev=8398&view=rev Author: tim_schofield Date: 2011-12-26 15:55:33 +0000 (Mon, 26 Dec 2011) Log Message: ----------- Remove select * sql, only retrieve fields we need Modified Paths: -------------- trunk/Customers.php Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2011-12-26 15:55:22 UTC (rev 8397) +++ trunk/Customers.php 2011-12-26 15:55:33 UTC (rev 8398) @@ -877,7 +877,15 @@ // echo '</td></tr><tr><td colspan="2">'; - $sql = "SELECT * FROM custcontacts where debtorno='".$DebtorNo."' ORDER BY contid"; + $sql = "SELECT contid, + debtorno, + contactname, + role, + phoneno, + notes + FROM custcontacts + WHERE debtorno='".$DebtorNo."' + ORDER BY contid"; $result = DB_query($sql,$db); echo '<table class="selection">'; @@ -913,13 +921,13 @@ <td>%s</td> <td>%s</td> </tr>', - $myrow[2], - $myrow[3], - $myrow[4], - $myrow[5], - $myrow[0], - $myrow[1], - $myrow[1]); + $myrow['contactname'], + $myrow['role'], + $myrow['phoneno'], + $myrow['notes'], + $myrow['contid'], + $myrow['debtorno'], + $myrow['debtorno']); } else { printf('<td>%s</td> <td>%s</td> @@ -928,15 +936,15 @@ <td><a href="AddCustomerContacts.php?Id=%s&DebtorNo=%s">'. _('Edit'). '</a></td> <td><a href="%sID=%s&DebtorNo=%s&delete=1">'. _('Delete'). '</a></td> </tr>', - $myrow[2], - $myrow[3], - $myrow[4], - $myrow[5], - $myrow[0], - $myrow[1], + $myrow['contactname'], + $myrow['role'], + $myrow['phoneno'], + $myrow['notes'], + $myrow['contid'], + $myrow['debtorno'], $_SERVER['PHP_SELF'] . '?', - $myrow[0], - $myrow[1]); + $myrow['contid'], + $myrow['debtorno']); } }//END WHILE LIST LOOP echo '</table>'; @@ -944,9 +952,13 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?DebtorNo='.$DebtorNo.'&ID='.$ID.'&Edit'.$Edit.'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($Edit) and $Edit!='') { - $SQLcustcontacts="SELECT * from custcontacts + $SQLcustcontacts="SELECT contactname, + role, + phoneno, + notes + FROM custcontacts WHERE debtorno='".$DebtorNo."' - and contid='".$ID."'"; + AND contid='".$ID."'"; $resultcc = DB_query($SQLcustcontacts,$db); $myrowcc = DB_fetch_array($resultcc); $_POST['custname']=$myrowcc['contactname']; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |