<?php $conn = mysqli_connect_db('127.0.0.1', 'projeto', '*senha@', 'configuracao'); mysqli_select_db($conn, 'configuracao'); $sqk = "SELECT * FROM pacote WHERE pacote = 'LC'"; echo $sql; mysqli_query($sql);
$q->bind_result($name, $value); $res = array(); while ($q->fetch()) { $res[] = array("Name" => $name, "Value" => $value); } $q->close(); Success($res); exit; break; case "submitScore": //Check passed params if (!isset($_GET["gameName"]) && !isset($_GET["userName"]) && !isset($_GET["value"])) { ErrorQuit(5, "Invalid Submit Score Parameters"); } //Connect to db $db = mysqli_connect_db(); $q = $db->prepare("INSERT INTO Kinect_Games (Name) VALUES (?)"); if (!$q) { ErrorQuit(6, "Failed to Lookup Game"); } $q->bind_param("s", $_GET["gameName"]); $q->execute(); $q->close(); $q2 = $db->prepare("INSERT INTO Kinect_Scores (Name, Value, GameID) " . "VALUES (?, ?, (SELECT id FROM Kinect_Games WHERE Kinect_Games.Name = ?))"); if (!$q2) { ErrorQuit(7, "Failed to Insert score"); } $q2->bind_param("sis", $_GET["userName"], $_GET["value"], $_GET["gameName"]); $q2->execute(); $q2->close(); Success(null);