joecooper Posted August 12, 2008 Share Posted August 12, 2008 this is a script that connects to a mysql database, and updates an entry in the prices table where ID = 1 i cant seem to work out why its getting a 500 error. the script is here: http://doom4files.com/update.php <?php session_start(); include("db.php"); //include database file $sql="SELECT price FROM price WHERE id=1 LIMIT 1"; $result=mysql_query($sql); $row = mysql_fetch_assoc($result); $price = $row['price'] $newprice = $price / 100 * 101 mysql_query("UPDATE price SET price = $newprice WHERE id = '1'"); echo "old price is $price, new price is $newprice"; ?> Link to comment https://forums.phpfreaks.com/topic/119353-500-internal-server-error/ Share on other sites More sharing options...
dezkit Posted August 12, 2008 Share Posted August 12, 2008 <?php session_start(); include("db.php"); //include database file $sql="SELECT price FROM price WHERE id=1 LIMIT 1"; $result=mysql_query($sql); $row = mysql_fetch_assoc($result); $price = $row['price']; $newprice = $price / 100 * 101; mysql_query("UPDATE price SET price = $newprice WHERE id = '1'"); echo "old price is $price, new price is $newprice"; ?> Link to comment https://forums.phpfreaks.com/topic/119353-500-internal-server-error/#findComment-614811 Share on other sites More sharing options...
joecooper Posted August 12, 2008 Author Share Posted August 12, 2008 oh... it would usually not give a 500 error Link to comment https://forums.phpfreaks.com/topic/119353-500-internal-server-error/#findComment-614814 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.