EliteConf
 All Data Structures Namespaces Files Functions Variables Pages
Connect_DatabaseController.php
Go to the documentation of this file.
1 <?php
2 
8 {
9  public function actionIndex()
10  {
11  $this->render('index');
12  }
13 
17  public static function connect()
18  {
19 
20  $con = mysql_connect("localhost","root","");
21  if (!$con)
22  {
23  die('Could not connect: ' . mysql_error());
24  //echo "FUCK";
25  }
26  else{
27  mysql_select_db("yii_tour", $con);
28  //echo "YES";
29  }
30 
31  /*
32  $confid = $_POST["val"];
33  $mail = $_POST["mail"];
34  $ty = $_POST["type"];
35 
36 
37  $con = mysql_connect("localhost","root","");
38  if (!$con)
39  {
40  die('Could not connect: ' . mysql_error());
41  }
42 
43  mysql_select_db("yii_tour", $con);
44 
45  echo $confid . "<br/>" . $mail . "<br/>" . $ty;
46 
47 
48  $result = mysql_query("SELECT * FROM users WHERE email='$mail'");
49 
50  if(mysql_fetch_array($result)==NULL) echo "No such user";
51  else{
52 
53  echo $confid . "<br/>" . $mail . "<br/>" . $ty . "<br/>";
54  $result = mysql_query("SELECT * FROM users WHERE email='$mail'");
55  } */
56  }
57 
58  // Uncomment the following methods and override them if needed
59  /*
60  public function filters()
61  {
62  // return the filter configuration for this controller, e.g.:
63  return array(
64  'inlineFilterName',
65  array(
66  'class'=>'path.to.FilterClass',
67  'propertyName'=>'propertyValue',
68  ),
69  );
70  }
71 
72  public function actions()
73  {
74  // return external action classes, e.g.:
75  return array(
76  'action1'=>'path.to.ActionClass',
77  'action2'=>array(
78  'class'=>'path.to.AnotherActionClass',
79  'propertyName'=>'propertyValue',
80  ),
81  );
82  }
83  */
84 }