Jump to content


Photo

Query don't run???


  • Please log in to reply
1 reply to this topic

#1 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 21 April 2006 - 02:46 PM

I can't figure out what's wrong with this...

while ($row=mysql_fetch_array($result)){
 $PN = $row['MFG1_PN'];
 $PLUS = "+";
 $NPN = $PN.$PLUS;
 echo $NPN." Added<br/>";
$sql=("update LBRYPERM set MFG5_PN = '$NPN' where MFG1_PN = '$PN' and MFG5 = ''") or die (mysql_error());}

It gives no error, and echos out ok, but doesn't write the data to the field... Am I missing something???

All this is supposed to do is take the part number in MFG1_PN and copy it to MFG1_PN and add a + to it

IF MFG1_PN is ABC123 then MFG5_PN should be ABC123+

#2 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 21 April 2006 - 02:58 PM

Below is a good example why you shouldn't write code when you have the flu...

[!--quoteo(post=367201:date=Apr 21 2006, 09:46 AM:name=AV1611)--][div class=\'quotetop\']QUOTE(AV1611 @ Apr 21 2006, 09:46 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I can't figure out what's wrong with this...

while ($row=mysql_fetch_array($result)){
 $PN = $row['MFG1_PN'];
 $PLUS = "+";
 $NPN = $PN.$PLUS;
 echo $NPN." Added<br/>";
$sql=

// I forgot to put mysql_query here


("update LBRYPERM set MFG5_PN = '$NPN' where MFG1_PN = '$PN' and MFG5 = ''") or die (mysql_error());}

It gives no error, and echos out ok, but doesn't write the data to the field... Am I missing something???

All this is supposed to do is take the part number in MFG1_PN and copy it to MFG1_PN and add a + to it

IF MFG1_PN is ABC123 then MFG5_PN should be ABC123+
[/quote]





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users