0

I have a high scores table for a game hosted on this webhost. I'm using PHP with sqlite pdo extensions to have access to the database. I can't seem to figure out what is happening to the database, as the query is not being inserted into the database. I know that the database is working and can be read from as I can get results out of the database. I get no output on the webpage saying something is wrong.

Additionally, I've tried a couple of differint methods of sending the query like with $dbConn->query("Select * from something;");.

include_once("Includes/connectDB.php"); 
$level = $_POST['level'];
$name = $_POST['name'];
$score = $_POST['score'];
$salvage = $_POST['salvage'];
$asteroids = $_POST['asteroids'];
$diff = $_POST['diff'];
if(($level > 0) and ($level <= 5))
{
    // make sure table exists
    $tbName = getHiS_Tb_Name($level);
    // insert data
    $sql = "Insert into $tbName (NAME, SCORE, SALVAGE_COLLECTED, ASTEROIDS_DESTROYED, DIFFICULTY)
        Values(:name , :score, :salvage, :asteroids, :diff);";
    try{
        $stmt = $dbConn->prepare($sql);
        $stmt->bindParam(':name', $name);
        $stmt->bindParam(':score', $score);
        $stmt->bindParam(':salvage', $salvage);
        $stmt->bindParam(':asteroids', $asteroids);
        $stmt->bindParam(':diff', $diff);

        $stmt->execute();
    }catch(PDOException $e){
        echo $e->getMessage();
    }
}
HSchmale
  • 1,838
  • 2
  • 21
  • 48
  • Are [errors enabled](http://stackoverflow.com/questions/845021/how-to-get-useful-error-messages-in-php#answer-845025)? – wavemode Apr 11 '15 at 02:51
  • @wavemode Errors are enabled. And the error log is empty – HSchmale Apr 11 '15 at 02:55
  • @Zero that function just generates the table name, and it worked when I had the code for MySQL. As originally I used a MySQL database with this. – HSchmale Apr 12 '15 at 15:02

0 Answers0