SQL error fix

This commit is contained in:
jacob 2010-11-18 15:59:22 +00:00
parent a8b0adce05
commit 31baeaa715
3 changed files with 5 additions and 3 deletions

View File

@ -26,13 +26,12 @@ include "common.inc.php";
require_once("account.inc.php");
require_once("user.inc.php");
require_once("schedule.inc.php");
/*
if($_SERVER['HTTPS']!="on") {
$ret['status']="error";
$ret['error']="SSL is required for API access, please access the API over https";
echo json_encode($ret);
exit;
}*/
}
$request=explode("/",$_GET['request']);
$ret=array();

View File

@ -113,6 +113,9 @@ Link username to email? <input type="radio" name="link_username_to_email" value=
<input type="submit" value="Edit Team">
</form>
<h1>User Stuff</h1>
<a href="api/user/view/">View the user</a><br/>
<h1>Event Schedule</h1>
<a href="api/schedule/list">Schedule Listing</a><br/>

View File

@ -725,7 +725,7 @@ function user_save(&$u)
){
mysql_query("DELETE FROM schedule_users_availability_link WHERE users_id = {$u['id']}");
if(count($u['available_events']) > 0){
$query = "INSERT INTO schedule_users_availability_link (users_id, schedule_id), VALUES (" . $u['id'] . ", ";
$query = "INSERT INTO schedule_users_availability_link (users_id, schedule_id) VALUES (" . $u['id'] . ", ";
$query .= implode('), (' . $u['id'] . ', ', $u['available_events']);
$query .= ")";
mysql_query($query);