Jump to content

jyanks

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by jyanks

  1. Appears to be working, thank you.
  2. Oh darn. Well, any help would be GREATLY appreciated.
  3. Ok so here's what I'm using: Host: http://stevie.heliohost.org Port: 2082 (Using the default value gives me a different error) Username/pw: CPanel Login credentials Error: "2013- Lost connection to MySQL server during query" Any thoughts? I feel like that error message is better than an unable to connect like I was getting before
  4. Also, does anyone know how to setup a connection to my MySQL database with NaviCat? I'm having an awful time and keep getting errors :|
  5. I want to make a php script that will setup my tables for me, but I'm getting errors when I try to do this. The odd thing is that it says that the syntax error occurs on line 8, but the script doesn't fail until around line 170. Here's my code: (Config.php just contains my db information, which I have double checked) <?php require_once("config.php"); //require_once("functions.php"); mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error()); mysql_select_db($dbname) or die(mysql_error()); echo "<br />Connected to database"; mysql_query("CREATE TABLE page_types( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), type_name VARCHAR(30))") or die(mysql_error()); echo "<br />Creating Table page_types"; mysql_query("INSERT INTO page_types (type_name) VALUES ('sexperts'), ('generic'), ('itempopup'), ('photogallery'), ('totaledit'), ('library'), ('events')") or die(mysql_error()); echo "<br />Filling Table"; mysql_query("CREATE TABLE product_types( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), type_name VARCHAR(30))") or die(mysql_error()); echo "<br />Creating Table product_types"; mysql_query("INSERT INTO product_types (type_name) VALUES ('condom'), ('lube'), ('misc')") or die(mysql_error()); echo "<br />Filling Table"; mysql_query("CREATE TABLE lib_item_types( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), type_name VARCHAR(30))") or die(mysql_error()); echo "<br />Creating Table lib_item_types"; mysql_query("INSERT INTO lib_item_types (type_name) VALUES ('dvd'), ('vhs'), ('book'), ('pamphlet'), ('other')") or die(mysql_error()); echo "<br />Filling Table"; mysql_query("CREATE TABLE content_page( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), doc_title VARCHAR(50), page_title VARCHAR(75), leftcolumn TEXT, rt_col_title TEXT, rt_col1_text TEXT, horizontal_rule1 TEXT, rt_col2_text TEXT, horizontal_rule2 TEXT, rt_col_3_text TEXT)") or die(mysql_error()); echo "<br />Creating Table content_page"; mysql_query("CREATE TABLE lib_items( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), item_type TINYINT(3), item_name VARCHAR(255), checked_in BOOL, item_year YEAR(4), item_desc TEXT)") or die(mysql_error()); echo "<br />Creating Table lib_items"; mysql_query("CREATE TABLE users( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), user_name VARCHAR(50), user_pw VARCHAR(255))") or die(mysql_error()); echo "<br />Creating Table users"; mysql_query("CREATE TABLE events( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), start_date DATE, end_date DATE, start_time TIME, end_time TIME, event_location VARCHAR(255), event_desc TEXT)") or die(mysql_error()); echo "<br />Creating Table events"; mysql_query("CREATE TABLE products( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), item_type TINYINT(3), item_name VARCHAR(255), extend_info TEXT, item_desc TEXT, item_picture VARCHAR(255)") or die(mysql_error()); echo "<br />Creating Table products"; mysql_query("CREATE TABLE center_info( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), phone_num VARCHAR(20), hotline_num VARCHAR(20), mon_hours VARCHAR(40), tues_hours VARCHAR(40), wed_hours VARCHAR(40), thurs_hours VARCHAR(40), fri_hours VARCHAR(40), sat_hours VARCHAR(40), sun_hours VARCHAR(40), location TEXT, email VARCHAR(255))") or die(mysql_error()); echo "<br />Creating Table center_info"; echo "<br />Tables Created!"; ?> Here is the output after running:
×
×
  • Create New...