How can I import and export data from mysql?

190 views
Skip to first unread message

Gianluca Belardinelli

unread,
Mar 8, 2013, 9:39:42 AM3/8/13
to jquery-wee...@googlegroups.com
I really need to interface a sql server with the calendar. I tried to follow some guideline but none of them helped me. I need something to make the sql interface with the calendar. If anybody can help me it would be appreciated.

Scott

unread,
Mar 8, 2013, 10:02:49 AM3/8/13
to jquery-wee...@googlegroups.com
I received your email and this is what I have left from the class I took and all the help everyone gave me on the forum and from class.

1. config.php below:
<?
$version = "2.0";
$installed = 1;
$use_auth = 1;

// MYSQL DB INFO
$DBHost = "localhost";
$DBName = " ";
$DBUser = " ";
$DBPass = " ";
$TBL_PR = "";

session_start();
?>

2. db.php below:
<?
$db_connection = mysql_connect ($DBHost, $DBUser, $DBPass) OR die (mysql_error()); 
$db_select = mysql_select_db ($DBName) or die (mysql_error());
?>

3. Here is my checklogin.php which should give you an idea about your session.php:
<?php
require_once("includes/config.php");
require_once("includes/db.php");
session_start();

$query = "SELECT user_id, eid, Title, Department FROM ".$TBL_PR."users WHERE eid='".addslashes($_POST['USER'])."' AND eid_pass='".addslashes(md5($_POST['PASS']))."' LIMIT 1";
            $query_result = mysql_query ($query);
            while ($info = mysql_fetch_array($query_result))
            {
                $admin_id = $info['user_id'];
                $admin_name = $info['eid'];
                $admin_title = $info['Title'];
                $admin_dept = $info['Department'];
            }
       
            IF(isset($admin_id))
            {
                $_SESSION['admin_id'] = $admin_id;
                $_SESSION['admin_name'] = $admin_name;
                $_SESSION['active_user'] = $admin_id;
                $_SESSION['admin_title'] = $admin_title;
                $_SESSION['admin_dept'] = $admin_dept;
                header("Location: " . $_POST['PAGE']);
                exit;
            }
            ELSE
            {
                die("User Login Failed");
            }

?>

4. I cant find functions.php but if you need anything else I can try to gather the information off my version which is a modified version of the calendar.

Gianluca Belardinelli

unread,
Mar 8, 2013, 10:09:27 AM3/8/13
to jquery-wee...@googlegroups.com
I responded you with mail. THANKS!
Reply all
Reply to author
Forward
0 new messages