elentz Posted February 7, 2008 Share Posted February 7, 2008 I have the code below. It won't do the update, all I get is a blank page and no update to my table. I know mu variables $mitax and $formatnet_total is correct since I can echo them to the page. Where have I mucked this up? $sql4 ="Update vtiger_invoicecf SET 'cf_602' = '$mitax', 'cf_604' = '$formatnet_total' where vtiger_invoicecf.invoice = '$id'"; $result = mysql_query($sql4) or die("Error in Query result"); Thanks Quote Link to comment https://forums.phpfreaks.com/topic/89959-solved-need-update-query-help/ Share on other sites More sharing options...
rhodesa Posted February 7, 2008 Share Posted February 7, 2008 What is the output of: $sql4 ="Update vtiger_invoicecf SET 'cf_602' = '$mitax', 'cf_604' = '$formatnet_total' where vtiger_invoicecf.invoice = '$id'"; echo $sql4; Quote Link to comment https://forums.phpfreaks.com/topic/89959-solved-need-update-query-help/#findComment-461181 Share on other sites More sharing options...
pocobueno1388 Posted February 7, 2008 Share Posted February 7, 2008 Try <?php $sql4 ="Update vtiger_invoicecf SET cf_602 = '$mitax', cf_604 = '$formatnet_total' where invoice = '$id'"; $result = mysql_query($sql4) or die(mysql_error() . "<p>With Query<br>$sql4"); Quote Link to comment https://forums.phpfreaks.com/topic/89959-solved-need-update-query-help/#findComment-461183 Share on other sites More sharing options...
rhodesa Posted February 7, 2008 Share Posted February 7, 2008 Try <?php $sql4 ="Update vtiger_invoicecf SET cf_602 = '$mitax', cf_604 = '$formatnet_total' where invoice = '$id'"; $result = mysql_query($sql4) or die(mysql_error() . "<p>With Query<br>$sql4"); good catch...that will definitely cause problems Quote Link to comment https://forums.phpfreaks.com/topic/89959-solved-need-update-query-help/#findComment-461192 Share on other sites More sharing options...
elentz Posted February 7, 2008 Author Share Posted February 7, 2008 You guys are quick!!!! I haven't tried it yet, but what was the "Catch"? Quote Link to comment https://forums.phpfreaks.com/topic/89959-solved-need-update-query-help/#findComment-461208 Share on other sites More sharing options...
rhodesa Posted February 7, 2008 Share Posted February 7, 2008 single quotes around the field names...there shouldn't be any or you should use backticks => ` Quote Link to comment https://forums.phpfreaks.com/topic/89959-solved-need-update-query-help/#findComment-461218 Share on other sites More sharing options...
elentz Posted February 7, 2008 Author Share Posted February 7, 2008 in other words a NOOBIE issue thanks alot guys that got me working. Quote Link to comment https://forums.phpfreaks.com/topic/89959-solved-need-update-query-help/#findComment-461230 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.