/[projects]/smsdaemon/webinterface/mysql.php
ViewVC logotype

Contents of /smsdaemon/webinterface/mysql.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 191 - (show annotations) (download)
Wed Dec 17 18:23:03 2008 UTC (15 years, 5 months ago) by torben
File size: 992 byte(s)
Added webinterface for trigger the smsdaemon remotely

1 <?
2 $DB_HOST="localhost";
3 $DB_USER="torben";
4 $DB_PASS="nielsen";
5 $DB_DATABASE="sms";
6
7 if ($MYSQLDB != 1) {
8
9 function query($string) {
10 global $DB_CONNECTION;
11 global $DB_DATABASE;
12 global $DB_USER;
13 global $DB_PASS;
14 global $DB_HOST;
15
16 if (!$DB_CONNECTION)
17 $DB_CONNECTION=mysql_connect($DB_HOST,$DB_USER,$DB_PASS);
18
19 mysql_select_db($DB_DATABASE, $DB_CONNECTION);
20 $sqlresult=mysql_query($string,$DB_CONNECTION);
21 if (!$sqlresult) {
22 return array();
23 }
24 while ($row=mysql_fetch_object($sqlresult)) {
25 $result[]=$row;
26 }
27 return $result;
28
29 }
30
31 function squery($string) {
32 global $DB_CONNECTION;
33 global $DB_DATABASE;
34 global $DB_USER;
35 global $DB_PASS;
36 global $DB_HOST;
37
38 if (!$DB_CONNECTION)
39 $DB_CONNECTION=mysql_connect($DB_HOST,$DB_USER,$DB_PASS);
40
41 mysql_select_db($DB_DATABASE, $DB_CONNECTION);
42 $sqlresult=mysql_query($string,$DB_CONNECTION);
43 return mysql_affected_rows();
44 }
45
46 $MYSQLDB = 1;
47 }
48 ?>

  ViewVC Help
Powered by ViewVC 1.1.20