Jump to content

500 internal server error???


joecooper

Recommended Posts

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

<?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";

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.