123456789101112131415161718192021222324252627282930313233 |
- <?php
- require_once("../../php/db_utils.php");
-
- try {
- // Connect to the database
- $database = db_connect();
-
- // Incoming data
- $canvasId = $_POST["canvas_id"];
-
- // Declare query
- $query = 'SELECT canvas_version FROM canvas WHERE canvas_id = "' . $canvasId . '";';
-
- // Run query
- $recordSet = db_query_return($database, $query);
-
- // Return the version if it exists
- $record = mysqli_fetch_assoc($recordSet);
-
- $canvasVersion = $record["canvas_version"];
-
- mysqli_free_result($recordSet);
-
- echo($canvasVersion);
-
- // Close the connection to the database
- db_close($database);
- }
- catch(Exception $e) {
- $errorMsg = $e->getMessage();
- print_r($errorMsg);
- }
- ?>
|