Code Problem
From: John Greco (john_at_rabweb_dot_com_at_foo.com)
Date: 12/31/03
- Next message: CountScubula: "Re: Append a text line by pressing a submit button"
- Previous message: chris: "Re: preg_replace and an include file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 31 Dec 2003 10:29:12 -0600
I am trying to build a web site for our inventory. I have a mysql DB that
I Connect to. The following code is what I use. The array products wont go
past the 61st ish product, when there are hundreds for it to deal with.
I tried this first:
$sql5 = "select * from product where whseNum = '".$whseNumber."' order by
prodNum";
$result5 = mysql_query($sql5, $conn) or die (mysql_errno() . ": " .
mysql_error(). "\n");
while ($row5 = mysql_fetch_array($result5))
{
$products[] = $row5['prodNum'];
}
foreach ($products as $prodNum => $value)
{
$sql4 = "UPDATE product SET physCount='".$_POST[$value]."' WHERE
prodNum='".$value."' AND whseNum='".$whseNumber."'";
$result4 = mysql_query($sql4, $conn) or die(mysql_errno() . ": " .
mysql_error(). "\n");
echo ("In the loop: ".$value);
}
Then I tried this:
$sql5 = "select * from product where whseNum = '".$whseNumber."' order by
prodNum";
$result5 = mysql_query($sql5, $conn) or die (mysql_errno() . ": " .
mysql_error(). "\n");
while ($row5 = mysql_fetch_assoc($result5))
{
$products[] = $row5['prodNum'];
$sql4 = "UPDATE product SET physCount='".$_POST[$value]."' WHERE
prodNum='".$row5['prodNum']."' AND whseNum='".$whseNumber."'";
$result4 = mysql_query($sql4, $conn) or die(mysql_errno() . ": " .
mysql_error(). "\n");
echo ("In the loop: ".$row5['prodNum']."<br>");
}
___________________________
John Greco
I.T. Department
RAB Electric Manufacturing, Inc.
Tel: 888 RAB-1000
Fax: 888 RAB-1232
Email: john@rabweb.com
##-----------------------------------------------##
Article posted from PHP Freaks NewsGroups
http://www.phpfreaks.com/newsgroups
Get Addicted: alt.php
##-----------------------------------------------##
- Next message: CountScubula: "Re: Append a text line by pressing a submit button"
- Previous message: chris: "Re: preg_replace and an include file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]