elentz Posted September 7, 2009 Share Posted September 7, 2009 I have a simple update query that I want to run from a php script. The query will work just fine from PHPMyadmin. But it won't update from the code I put into the script. What have I got wrong here? // connect to db $conn = mysql_connect('localhost','couniq','9AXMY') or trigger_error("SQL", E_USER_ERROR); $db = mysql_select_db('communiq_vtcrm1',$conn) or trigger_error("SQL", E_USER_ERROR); //Update Query to do the math for the extended prices of items sold $sql = "Update vtiger_inventoryproductrel SET extlistprice = quantity * listprice"; $result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR); mysql_close(); Thanks Quote Link to comment https://forums.phpfreaks.com/topic/173408-simple-query-help-needed/ Share on other sites More sharing options...
Lyleyboy Posted September 7, 2009 Share Posted September 7, 2009 Do you get any error messages? Quote Link to comment https://forums.phpfreaks.com/topic/173408-simple-query-help-needed/#findComment-914266 Share on other sites More sharing options...
elentz Posted September 8, 2009 Author Share Posted September 8, 2009 Nope Quote Link to comment https://forums.phpfreaks.com/topic/173408-simple-query-help-needed/#findComment-914763 Share on other sites More sharing options...
PFMaBiSmAd Posted September 8, 2009 Share Posted September 8, 2009 What does adding the following two lines immediately after the first opening <?php tag give - ini_set("display_errors", "1"); error_reporting(E_ALL); Quote Link to comment https://forums.phpfreaks.com/topic/173408-simple-query-help-needed/#findComment-914768 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.