AV1611 Posted April 21, 2006 Share Posted April 21, 2006 I can't figure out what's wrong with this...[code]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());}[/code]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 itIF MFG1_PN is ABC123 then MFG5_PN should be ABC123+ Link to comment https://forums.phpfreaks.com/topic/8044-query-dont-run/ Share on other sites More sharing options...
AV1611 Posted April 21, 2006 Author Share Posted April 21, 2006 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) [snapback]367201[/snapback][/div][div class=\'quotemain\'][!--quotec--]I can't figure out what's wrong with this...[code]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());}[/code]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 itIF MFG1_PN is ABC123 then MFG5_PN should be ABC123+[/quote] Link to comment https://forums.phpfreaks.com/topic/8044-query-dont-run/#findComment-29348 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.