Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: PHP Problem ;[

  1. #1
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default PHP Problem ;[

    Hi,

    It worked fine when I tested it on localhost but when I tested it on my server it dident create the tables or give a error message:

    PHP Code:
    <?php include('../Connections/MySQL.php'); ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>
    <body>
    <p>SQL Creation...<br />
    <?php
    $filename 
    "install.lck";
    if (
    file_exists($filename)) {
    echo 
    "ERROR: CANNOT INSTALL. THIS SETUP SCRIPT HAS RUN BEFORE!!!";
    } else { 
    echo 
    "Selecting DB...";
    mysql_select_db($database_mysql$mysql);  
    echo 
    "OK <br />";
    echo 
    "Making Table Alert...";
    mysql_query("CREATE TABLE `alert` (
      `ID` int(4) NOT NULL auto_increment,
      `message` text NOT NULL,
      `active` char(1) NOT NULL default '',
      PRIMARY KEY  (`ID`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;"
    );
    echo 
    "OK <br />";
    echo 
    "Making Table Config...";
    mysql_query("CREATE TABLE `config` (
      `id` int(10) NOT NULL auto_increment,
      `name` longtext NOT NULL,
      `value` longtext NOT NULL,
      PRIMARY KEY  (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;"
    );
    echo 
    "OK <br />";
    echo 
    "Inserting Default Values into config...";
    mysql_query("INSERT INTO `config` VALUES (1, 'adminmsg', 'Default Message, please edit.');
    INSERT INTO `config` VALUES (2, 'djsays', 'DJ SAYS DEFAULT');"
    );
    echo 
    "OK <br />";
    echo 
    "Making Table Requests...";
    mysql_query("CREATE TABLE `requests` (
      `id` int(10) NOT NULL auto_increment,
      `name` longtext NOT NULL,
      `type` longtext NOT NULL,
      `msg` longtext NOT NULL,
      PRIMARY KEY  (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;"
    );
    echo 
    "OK <br />";
    echo 
    "Making Table tmtbl...";
    mysql_query("CREATE TABLE `tmtbl` (
      `id` int(10) NOT NULL auto_increment,
      `day` longtext NOT NULL,
      `time` longtext NOT NULL,
      `dj` longtext NOT NULL,
      PRIMARY KEY  (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=169 ;"
    );
    echo 
    "OK <br />";
    echo 
    "Inserting Values into tmtbl...";
    mysql_query("INSERT INTO `tmtbl` VALUES (1, 'monday', '0:00 - 1:00', '');
    INSERT INTO `tmtbl` VALUES (2, 'monday', '1:00 - 2:00', '');
    INSERT INTO `tmtbl` VALUES (3, 'monday', '2:00 - 3:00', '');
    INSERT INTO `tmtbl` VALUES (4, 'monday', '3:00 - 4:00', '');
    INSERT INTO `tmtbl` VALUES (5, 'monday', '4:00 - 5:00', '');
    INSERT INTO `tmtbl` VALUES (6, 'monday', '5:00 - 6:00', '');
    INSERT INTO `tmtbl` VALUES (7, 'monday', '6:00 - 7:00', '');
    INSERT INTO `tmtbl` VALUES (8, 'monday', '7:00 - 8:00', '');
    INSERT INTO `tmtbl` VALUES (9, 'monday', '8:00 - 9:00', '');
    INSERT INTO `tmtbl` VALUES (10, 'monday', '9:00 - 10:00', '');
    INSERT INTO `tmtbl` VALUES (11, 'monday', '10:00 - 11:00', '');
    INSERT INTO `tmtbl` VALUES (12, 'monday', '11:00 - 12:00', '');
    INSERT INTO `tmtbl` VALUES (13, 'monday', '12:00 - 13:00', '');
    INSERT INTO `tmtbl` VALUES (14, 'monday', '13:00 - 14:00', '');
    INSERT INTO `tmtbl` VALUES (15, 'monday', '14:00 - 15:00', '');
    INSERT INTO `tmtbl` VALUES (16, 'monday', '15:00 - 16:00', '');
    INSERT INTO `tmtbl` VALUES (17, 'monday', '16:00 - 17:00', '');
    INSERT INTO `tmtbl` VALUES (18, 'monday', '17:00 - 18:00', '');
    INSERT INTO `tmtbl` VALUES (19, 'monday', '18:00 - 19:00', '');
    INSERT INTO `tmtbl` VALUES (20, 'monday', '19:00 - 20:00', '');
    INSERT INTO `tmtbl` VALUES (21, 'monday', '20:00 - 21:00', '');
    INSERT INTO `tmtbl` VALUES (22, 'monday', '21:00 - 22:00', '');
    INSERT INTO `tmtbl` VALUES (23, 'monday', '22:00 - 23:00', '');
    INSERT INTO `tmtbl` VALUES (24, 'monday', '23:00 - 0:00', '');
    INSERT INTO `tmtbl` VALUES (25, 'tuesday', '0:00 - 1:00', '');
    INSERT INTO `tmtbl` VALUES (26, 'tuesday', '1:00 - 2:00', '');
    INSERT INTO `tmtbl` VALUES (27, 'tuesday', '2:00 - 3:00', '');
    INSERT INTO `tmtbl` VALUES (28, 'tuesday', '3:00 - 4:00', '');
    INSERT INTO `tmtbl` VALUES (29, 'tuesday', '4:00 - 5:00', '');
    INSERT INTO `tmtbl` VALUES (30, 'tuesday', '5:00 - 6:00', '');
    INSERT INTO `tmtbl` VALUES (31, 'tuesday', '6:00 - 7:00', '');
    INSERT INTO `tmtbl` VALUES (32, 'tuesday', '7:00 - 8:00', '');
    INSERT INTO `tmtbl` VALUES (33, 'tuesday', '8:00 - 9:00', '');
    INSERT INTO `tmtbl` VALUES (34, 'tuesday', '9:00 - 10:00', '');
    INSERT INTO `tmtbl` VALUES (35, 'tuesday', '10:00 - 11:00', '');
    INSERT INTO `tmtbl` VALUES (36, 'tuesday', '11:00 - 12:00', '');
    INSERT INTO `tmtbl` VALUES (37, 'tuesday', '12:00 - 13:00', '');
    INSERT INTO `tmtbl` VALUES (38, 'tuesday', '13:00 - 14:00', '');
    INSERT INTO `tmtbl` VALUES (39, 'tuesday', '14:00 - 15:00', '');
    INSERT INTO `tmtbl` VALUES (40, 'tuesday', '15:00 - 16:00', '');
    INSERT INTO `tmtbl` VALUES (41, 'tuesday', '16:00 - 17:00', '');
    INSERT INTO `tmtbl` VALUES (42, 'tuesday', '17:00 - 18:00', '');
    INSERT INTO `tmtbl` VALUES (43, 'tuesday', '18:00 - 19:00', '');
    INSERT INTO `tmtbl` VALUES (44, 'tuesday', '19:00 - 20:00', '');
    INSERT INTO `tmtbl` VALUES (45, 'tuesday', '20:00 - 21:00', '');
    INSERT INTO `tmtbl` VALUES (46, 'tuesday', '21:00 - 22:00', '');
    INSERT INTO `tmtbl` VALUES (47, 'tuesday', '22:00 - 23:00', '');
    INSERT INTO `tmtbl` VALUES (48, 'tuesday', '23:00 - 0:00', '');
    INSERT INTO `tmtbl` VALUES (49, 'wednesday', '0:00 - 1:00', '');
    INSERT INTO `tmtbl` VALUES (50, 'wednesday', '1:00 - 2:00', '');
    INSERT INTO `tmtbl` VALUES (51, 'wednesday', '2:00 - 3:00', '');
    INSERT INTO `tmtbl` VALUES (52, 'wednesday', '3:00 - 4:00', '');
    INSERT INTO `tmtbl` VALUES (53, 'wednesday', '4:00 - 5:00', '');
    INSERT INTO `tmtbl` VALUES (54, 'wednesday', '5:00 - 6:00', '');
    INSERT INTO `tmtbl` VALUES (55, 'wednesday', '6:00 - 7:00', '');
    INSERT INTO `tmtbl` VALUES (56, 'wednesday', '7:00 - 8:00', '');
    INSERT INTO `tmtbl` VALUES (57, 'wednesday', '8:00 - 9:00', '');
    INSERT INTO `tmtbl` VALUES (58, 'wednesday', '9:00 - 10:00', '');
    INSERT INTO `tmtbl` VALUES (59, 'wednesday', '10:00 - 11:00', '');
    INSERT INTO `tmtbl` VALUES (60, 'wednesday', '11:00 - 12:00', '');
    INSERT INTO `tmtbl` VALUES (61, 'wednesday', '12:00 - 13:00', '');
    INSERT INTO `tmtbl` VALUES (62, 'wednesday', '13:00 - 14:00', '');
    INSERT INTO `tmtbl` VALUES (63, 'wednesday', '14:00 - 15:00', '');
    INSERT INTO `tmtbl` VALUES (64, 'wednesday', '15:00 - 16:00', '');
    INSERT INTO `tmtbl` VALUES (65, 'wednesday', '16:00 - 17:00', '');
    INSERT INTO `tmtbl` VALUES (66, 'wednesday', '17:00 - 18:00', '');
    INSERT INTO `tmtbl` VALUES (67, 'wednesday', '18:00 - 19:00', '');
    INSERT INTO `tmtbl` VALUES (68, 'wednesday', '19:00 - 20:00', '');
    INSERT INTO `tmtbl` VALUES (69, 'wednesday', '20:00 - 21:00', '');
    INSERT INTO `tmtbl` VALUES (70, 'wednesday', '21:00 - 22:00', '');
    INSERT INTO `tmtbl` VALUES (71, 'wednesday', '22:00 - 23:00', '');
    INSERT INTO `tmtbl` VALUES (72, 'wednesday', '23:00 - 0:00', '');
    INSERT INTO `tmtbl` VALUES (73, 'thursday', '0:00 - 1:00', '');
    INSERT INTO `tmtbl` VALUES (74, 'thursday', '1:00 - 2:00', '');
    INSERT INTO `tmtbl` VALUES (75, 'thursday', '2:00 - 3:00', '');
    INSERT INTO `tmtbl` VALUES (76, 'thursday', '3:00 - 4:00', '');
    INSERT INTO `tmtbl` VALUES (77, 'thursday', '4:00 - 5:00', '');
    INSERT INTO `tmtbl` VALUES (78, 'thursday', '5:00 - 6:00', '');
    INSERT INTO `tmtbl` VALUES (79, 'thursday', '6:00 - 7:00', '');
    INSERT INTO `tmtbl` VALUES (80, 'thursday', '7:00 - 8:00', '');
    INSERT INTO `tmtbl` VALUES (81, 'thursday', '8:00 - 9:00', '');
    INSERT INTO `tmtbl` VALUES (82, 'thursday', '9:00 - 10:00', '');
    INSERT INTO `tmtbl` VALUES (83, 'thursday', '10:00 - 11:00', '');
    INSERT INTO `tmtbl` VALUES (84, 'thursday', '11:00 - 12:00', '');
    INSERT INTO `tmtbl` VALUES (85, 'thursday', '12:00 - 13:00', '');
    INSERT INTO `tmtbl` VALUES (86, 'thursday', '13:00 - 14:00', '');
    INSERT INTO `tmtbl` VALUES (87, 'thursday', '14:00 - 15:00', '');
    INSERT INTO `tmtbl` VALUES (88, 'thursday', '15:00 - 16:00', '');
    INSERT INTO `tmtbl` VALUES (89, 'thursday', '16:00 - 17:00', '');
    INSERT INTO `tmtbl` VALUES (90, 'thursday', '17:00 - 18:00', '');
    INSERT INTO `tmtbl` VALUES (91, 'thursday', '18:00 - 19:00', '');
    INSERT INTO `tmtbl` VALUES (92, 'thursday', '19:00 - 20:00', '');
    INSERT INTO `tmtbl` VALUES (93, 'thursday', '20:00 - 21:00', '');
    INSERT INTO `tmtbl` VALUES (94, 'thursday', '21:00 - 22:00', '');
    INSERT INTO `tmtbl` VALUES (95, 'thursday', '22:00 - 23:00', '');
    INSERT INTO `tmtbl` VALUES (96, 'thursday', '23:00 - 0:00', '');
    INSERT INTO `tmtbl` VALUES (97, 'friday', '0:00 - 1:00', '');
    INSERT INTO `tmtbl` VALUES (98, 'friday', '1:00 - 2:00', '');
    INSERT INTO `tmtbl` VALUES (99, 'friday', '2:00 - 3:00', '');
    INSERT INTO `tmtbl` VALUES (100, 'friday', '3:00 - 4:00', '');
    INSERT INTO `tmtbl` VALUES (101, 'friday', '4:00 - 5:00', '');
    INSERT INTO `tmtbl` VALUES (102, 'friday', '5:00 - 6:00', '');
    INSERT INTO `tmtbl` VALUES (103, 'friday', '6:00 - 7:00', '');
    INSERT INTO `tmtbl` VALUES (104, 'friday', '7:00 - 8:00', '');
    INSERT INTO `tmtbl` VALUES (105, 'friday', '8:00 - 9:00', '');
    INSERT INTO `tmtbl` VALUES (106, 'friday', '9:00 - 10:00', '');
    INSERT INTO `tmtbl` VALUES (107, 'friday', '10:00 - 11:00', '');
    INSERT INTO `tmtbl` VALUES (108, 'friday', '11:00 - 12:00', '');
    INSERT INTO `tmtbl` VALUES (109, 'friday', '12:00 - 13:00', '');
    INSERT INTO `tmtbl` VALUES (110, 'friday', '13:00 - 14:00', '');
    INSERT INTO `tmtbl` VALUES (111, 'friday', '14:00 - 15:00', '');
    INSERT INTO `tmtbl` VALUES (112, 'friday', '15:00 - 16:00', '');
    INSERT INTO `tmtbl` VALUES (113, 'friday', '16:00 - 17:00', '');
    INSERT INTO `tmtbl` VALUES (114, 'friday', '17:00 - 18:00', '');
    INSERT INTO `tmtbl` VALUES (115, 'friday', '18:00 - 19:00', '');
    INSERT INTO `tmtbl` VALUES (116, 'friday', '19:00 - 20:00', '');
    INSERT INTO `tmtbl` VALUES (117, 'friday', '20:00 - 21:00', '');
    INSERT INTO `tmtbl` VALUES (118, 'friday', '21:00 - 22:00', '');
    INSERT INTO `tmtbl` VALUES (119, 'friday', '22:00 - 23:00', '');
    INSERT INTO `tmtbl` VALUES (120, 'friday', '23:00 - 0:00', '');
    INSERT INTO `tmtbl` VALUES (121, 'saturday', '0:00 - 1:00', '');
    INSERT INTO `tmtbl` VALUES (122, 'saturday', '1:00 - 2:00', '');
    INSERT INTO `tmtbl` VALUES (123, 'saturday', '2:00 - 3:00', '');
    INSERT INTO `tmtbl` VALUES (124, 'saturday', '3:00 - 4:00', '');
    INSERT INTO `tmtbl` VALUES (125, 'saturday', '4:00 - 5:00', '');
    INSERT INTO `tmtbl` VALUES (126, 'saturday', '5:00 - 6:00', '');
    INSERT INTO `tmtbl` VALUES (127, 'saturday', '6:00 - 7:00', '');
    INSERT INTO `tmtbl` VALUES (128, 'saturday', '7:00 - 8:00', '');
    INSERT INTO `tmtbl` VALUES (129, 'saturday', '8:00 - 9:00', '');
    INSERT INTO `tmtbl` VALUES (130, 'saturday', '9:00 - 10:00', '');
    INSERT INTO `tmtbl` VALUES (131, 'saturday', '10:00 - 11:00', '');
    INSERT INTO `tmtbl` VALUES (132, 'saturday', '11:00 - 12:00', '');
    INSERT INTO `tmtbl` VALUES (133, 'saturday', '12:00 - 13:00', '');
    INSERT INTO `tmtbl` VALUES (134, 'saturday', '13:00 - 14:00', '');
    INSERT INTO `tmtbl` VALUES (135, 'saturday', '14:00 - 15:00', '');
    INSERT INTO `tmtbl` VALUES (136, 'saturday', '15:00 - 16:00', '');
    INSERT INTO `tmtbl` VALUES (137, 'saturday', '16:00 - 17:00', '');
    INSERT INTO `tmtbl` VALUES (138, 'saturday', '17:00 - 18:00', '');
    INSERT INTO `tmtbl` VALUES (139, 'saturday', '18:00 - 19:00', '');
    INSERT INTO `tmtbl` VALUES (140, 'saturday', '19:00 - 20:00', '');
    INSERT INTO `tmtbl` VALUES (141, 'saturday', '20:00 - 21:00', '');
    INSERT INTO `tmtbl` VALUES (142, 'saturday', '21:00 - 22:00', '');
    INSERT INTO `tmtbl` VALUES (143, 'saturday', '22:00 - 23:00', '');
    INSERT INTO `tmtbl` VALUES (144, 'saturday', '23:00 - 0:00', '');
    INSERT INTO `tmtbl` VALUES (145, 'sunday', '0:00 - 1:00', '');
    INSERT INTO `tmtbl` VALUES (146, 'sunday', '1:00 - 2:00', '');
    INSERT INTO `tmtbl` VALUES (147, 'sunday', '2:00 - 3:00', '');
    INSERT INTO `tmtbl` VALUES (148, 'sunday', '3:00 - 4:00', '');
    INSERT INTO `tmtbl` VALUES (149, 'sunday', '4:00 - 5:00', '');
    INSERT INTO `tmtbl` VALUES (150, 'sunday', '5:00 - 6:00', '');
    INSERT INTO `tmtbl` VALUES (151, 'sunday', '6:00 - 7:00', '');
    INSERT INTO `tmtbl` VALUES (152, 'sunday', '7:00 - 8:00', '');
    INSERT INTO `tmtbl` VALUES (153, 'sunday', '8:00 - 9:00', '');
    INSERT INTO `tmtbl` VALUES (154, 'sunday', '9:00 - 10:00', '');
    INSERT INTO `tmtbl` VALUES (155, 'sunday', '10:00 - 11:00', '');
    INSERT INTO `tmtbl` VALUES (156, 'sunday', '11:00 - 12:00', '');
    INSERT INTO `tmtbl` VALUES (157, 'sunday', '12:00 - 13:00', '');
    INSERT INTO `tmtbl` VALUES (158, 'sunday', '13:00 - 14:00', '');
    INSERT INTO `tmtbl` VALUES (159, 'sunday', '14:00 - 15:00', '');
    INSERT INTO `tmtbl` VALUES (160, 'sunday', '15:00 - 16:00', '');
    INSERT INTO `tmtbl` VALUES (161, 'sunday', '16:00 - 17:00', '');
    INSERT INTO `tmtbl` VALUES (162, 'sunday', '17:00 - 18:00', '');
    INSERT INTO `tmtbl` VALUES (163, 'sunday', '18:00 - 19:00', '');
    INSERT INTO `tmtbl` VALUES (164, 'sunday', '19:00 - 20:00', '');
    INSERT INTO `tmtbl` VALUES (165, 'sunday', '20:00 - 21:00', '');
    INSERT INTO `tmtbl` VALUES (166, 'sunday', '21:00 - 22:00', '');
    INSERT INTO `tmtbl` VALUES (167, 'sunday', '22:00 - 23:00', '');
    INSERT INTO `tmtbl` VALUES (168, 'sunday', '23:00 - 0:00', '');
    "
    );
    echo 
    "OK <br />";
    echo 
    "Making Table users...";
    mysql_query("CREATE TABLE `users` (
      `id` int(10) NOT NULL auto_increment,
      `username` longtext NOT NULL,
      `password` longtext NOT NULL,
      `email` longtext NOT NULL,
      `permission` longtext NOT NULL,
      PRIMARY KEY  (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;"
    );
    echo 
    "OK <br />";
    echo 
    "Inserting Default Values into users...";
    mysql_query("INSERT INTO `users` VALUES (1, 'admin', 'admin', '[email protected]', 'admin');");
    echo 
    "OK <br />";
    echo 
    "Install Complete... Please edit config.php and you are ready to go!! If you need to reinstall for any reason please delete install.lck from the install directory.";
    $file 'install.txt';
    $newfile 'install.lck';

    if (!
    rename("install.txt""install.lck")) {
       echo 
    "failed to copy installer lock file. We recomend you rename install.l to install.lck to prevent this file from being able to run.";
    }

    }
    ?>
    </p>
    </body>
    </html>

  2. #2
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Check the server is useing the same version of mysql as your testing server. I had a big problem when trying to import one of mine from my host to my testing server, althogh i fixed it buy getting phpmyadmin to genoirate the code in copatablty mode with my mysql version "/

    I duno if that would help. but it could be something to do with that, since the diffences in formating end up causieng errors, when its run

  3. #3
    Join Date
    Oct 2004
    Location
    Scotland
    Posts
    2,280
    Tokens
    1,075

    Latest Awards:

    Default

    <html xmlns="http://www.w3.org/1999/xhtml">
    Remove that line of code and try it.

    if not What exactly is the error your getting?

    http://www.stupidian.com
    (contains mild swearing)

  4. #4
    Join Date
    Apr 2006
    Location
    England
    Posts
    71
    Tokens
    0

    Default

    What is the error message you are getting? or is it not creating the tables?

  5. #5
    Join Date
    Oct 2004
    Location
    Scotland
    Posts
    2,280
    Tokens
    1,075

    Latest Awards:

    Default

    i dont think PHP scripts are meanto create tables :s

    http://www.stupidian.com
    (contains mild swearing)

  6. #6
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    Yea they are thats why they have install.php files :p

  7. #7
    Join Date
    Aug 2004
    Location
    Sawley
    Posts
    771
    Tokens
    1,631
    Habbo
    T0X!C-uk

    Latest Awards:

    Default

    i think i have spotted the problem

    check this line:
    PHP Code:
    <?php include('../Connections/MySQL.php'); ?>
    This my be trying to find theMySQL.php file from you computer try uploading the file to the public_html file on your hosting account and chaging the above line to.
    PHP Code:
    <? include ("MySQL.php"); ?>
    Last edited by T0X!C-uk; 23-04-2006 at 09:30 PM.

  8. #8
    Join Date
    Oct 2004
    Location
    Scotland
    Posts
    2,280
    Tokens
    1,075

    Latest Awards:

    Default

    yeah but that doesnt look like an install file. If it is, he should just scrap the code and create the tables + do the config himselelf

    http://www.stupidian.com
    (contains mild swearing)

  9. #9
    Join Date
    Aug 2004
    Location
    Sawley
    Posts
    771
    Tokens
    1,631
    Habbo
    T0X!C-uk

    Latest Awards:

    Default

    Quote Originally Posted by -JT-
    yeah but that doesnt look like an install file. If it is, he should just scrap the code and create the tables + do the config himselelf
    Yeah the coding does eem a bit wierd to be an install file...Usally they just conntent to the database and execute the sql within the install file

  10. #10
    Join Date
    Aug 2004
    Location
    bristol
    Posts
    3,799
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by -JT-
    Remove that line of code and try it.

    if not What exactly is the error your getting?
    And that will help him how?
    kinda quit.

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •