Hi there,
I’m a complete and utter noob to modX, barely past the installation stage! I have been messing around with snippets and am looking at getting some of my database driven content into snippets.
I have a problem however. When I make normal database calls....nothing seems to happen at all! the page does not error, I just get nothing back from my database queries!
>>>>>>>>>>Sample code<<<<<<<<<<:
$hostname_ir_training = "localhost";
$database_ir_training = "mydb";
$username_ir_training = "root";
$password_ir_training = "blahblah";
$ir_training = mysql_pconnect($hostname_ir_training, $username_ir_training, $password_ir_training) or trigger_error(mysql_error(),E_USER_ERROR);
$search = date("Y-m-d");
//mysql_select_db($database_ir_training, $ir_training);
$query_schedule = "SELECT *,DATE_FORMAT(event.event_Start,’%c’) as monthNumber,DATE_FORMAT(event.event_Start,’%M’) as monthCheck, courses.course_Name, courses.course_Price, courses.course_Duration, event.event_Start FROM courses, event where courses.course_ID = event.course_ID and event.event_Start > ’$search’ order by courses.course_ID,event.event_Start";
$schedule = mysql_query($query_schedule, $ir_training) or die(mysql_error());
$row_schedule = mysql_fetch_assoc($schedule);
When I then make calls to the above I get nothing! Which is strange as I thought i’d at least get an error!
eg:
$out = $row_schedule[’course_Duration’];
return $out;
This gives me nothing. I am aware that I can use the API to call the DB, and could probably move my old DB into the modX one and call it that way...but thats far too much work
Please help