Ajax Event Calendar Support Product Page

This topic is locked

sql error

Asked 27 Jan 2011 23:15:08
1
has this question
27 Jan 2011 23:15:08 Web Master posted:
trying to connect the data to my calendar but get this error

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[Title_Column] AS title, [Start_Column] AS start, [stop_Column] AS stop , [Descr' at line 1


below is the feed file:

<?php 
/*
table="[Calendar]"
title="[Title_Column]"
start="[Start_Column]"
stop="[stop_Column]"
description="[Description_Column]"
type="[Type_Column]"
link="[[Link_Column] AS link]"
event_id="[ID_Column]"
db_type="mssql"
*/
require_once('../ScriptLibrary/xmlrpc.inc');
require_once('../ScriptLibrary/jsonrpc.inc');
require_once('../ScriptLibrary/json_extension_api.inc');
require_once('../Connections/wgncetv.php');
if (!isset($_GET['start']))
{
  header("HTTP/1.0 400 Bad Request");
  echo "Start is required";
  exit();
}
else if (!is_numeric($_GET['start'])) 
{
  header("HTTP/1.0 400 Bad Request");
  echo "Start should be a numeric value";
  exit();
}
else if (!isset($_GET['stop']))
{
  header("HTTP/1.0 400 Bad Request");
  echo "Stop is required";
  exit();
}
else if (!is_numeric($_GET['stop'])) 
{
  header("HTTP/1.0 400 Bad Request");
  echo "Stop should be a numeric value";
  exit();
}
else
{
$query_start = intval($_GET['start']);
$query_stop =  intval($_GET['stop']);
mysql_select_db($database_wgncetv, $wgncetv);
$query_events = sprintf('SELECT [Title_Column] AS title, [Start_Column] AS start, [stop_Column] AS stop , [Description_Column] AS description, [Type_Column] AS type, [ID_Column] AS event_id FROM [Calendar] WHERE [Start_Column] <= %1$d AND ([stop_Column] >= %2$d OR (ISNULL([stop_Column]) AND [Start_Column] >= %2$d))',$query_stop, $query_start);
$events_set = mysql_query($query_events, $wgncetv) or die(mysql_error());  
$result_array = array();
while ($row = mysql_fetch_assoc($events_set))
{
	$result_array[] =  $row;
}	
header("Cache-Control: no-cache");
if(isset($_GET['callback']))
{
  echo $_GET['callback']."(".json_encode($result_array).");";
}
else
{
  echo json_encode($result_array);
}
}
?>


Replies

Replied 28 Jan 2011 15:43:47
28 Jan 2011 15:43:47 Web Master replied:
Code the extension is generating is wrong says db_type = "mssql" when clearly from the query itself below the DB type is Mysql
Think you have a bug here:


<?php   
/*  
table="[Calendar]"  
title="[Title_Column]"  
start="[Start_Column]"  
stop="[stop_Column]"  
description="[Description_Column]"  
type="[Type_Column]"  
link="[[Link_Column] AS link]"  
event_id="[ID_Column]"  
db_type="mssql"  
*/  

Replied 31 Jan 2011 11:14:06
31 Jan 2011 11:14:06 Teodor Kuduschiev replied:
This problem was resolved in a Live Chat session by clearing Dreamweaver cache file.

Reply to this topic