Jump to content


Photo

Installing Tables


  • Please log in to reply
6 replies to this topic

#1 mark_wi

mark_wi
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 19 May 2006 - 11:40 PM

I have a script I have been working on and it seems to no longer install on my server I tested on another on and it installs just fine.

Here is the part which is used to install

echo "<center><h3>Installing...</h3></center>";
    $dbi = mysql_connect($db_host, $db_username, $db_pass);
    mysql_select_db("$db_name",$dbi);
    echo "<center><font face=\"monospace\">Creating Main Cam Table <b>".$prefix."_cams</b>...</font></center>";
    $sql = 'CREATE TABLE ';
    $sql .=    $prefix;
    $sql .= '_cams( camname varchar( 60 ) NOT NULL default \'\', email varchar( 255 ) NOT NULL default \'\', camurl varchar( 255 ) NOT NULL default \'\', url varchar( 255 ) NOT NULL default \'\', id int( 11 ) NOT NULL default \'\'auto_increment, noupdate tinyint( 11 ) NOT NULL default \'0\', PRIMARY KEY ( id ) ) TYPE = MYISAM ';     
    $result = mysql_query($sql);
    if(!$result){echo "<center><font color=\"red\" face=\"monospace\">Error!</font></center><br><br>\n\n";die();}
    else {echo "<center><font color=\"blue\" face=\"monospace\">Success!</font></center><br><br>\n\n";}

    echo "<center><font face=\"monospace\">Creating Temp Cam Table <b>".$prefix."_cams_temp</b>...</font></center>";
    $sql = 'CREATE TABLE ';
    $sql .=    $prefix;
    $sql .= '_cams_temp(camname varchar(60) NOT NULL default \'\', email varchar(255) NOT NULL default \'\', camurl varchar(255) NOT NULL default \'\', url varchar(255) NOT NULL default \'\' ) TYPE=MyISAM ';     
    $result = mysql_query($sql);
    if(!$result){echo "<center><font color=\"red\" face=\"monospace\">Error!</font></center><br><br>\n\n";die();}
    else {echo "<center><font color=\"blue\" face=\"monospace\">Success!</font></center><br><br>\n\n";}


#2 Houdini

Houdini
  • Members
  • PipPip
  • Member
  • 17 posts

Posted 20 May 2006 - 12:40 AM

Is it possible that one server allows 'short' tags and the one where the script does not work is not using short tags. e.g. <?php verses <? If the Script starts with <? and not <?php then change it to <?php and try again.
We the unwilling, led by the unknowing,
have done so much, for so long, with so little,
that we are now quqlified to do anything, with nothing!

#3 mark_wi

mark_wi
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 20 May 2006 - 01:04 AM

[!--quoteo(post=375405:date=May 19 2006, 07:40 PM:name=Houdini)--][div class=\'quotetop\']QUOTE(Houdini @ May 19 2006, 07:40 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Is it possible that one server allows 'short' tags and the one where the script does not work is not using short tags. e.g. <?php verses <? If the Script starts with <? and not <?php then change it to <?php and try again.
[/quote]

I do have the scripts starting with <?php this is the full setup


if (!empty($_GET)) {
extract($_GET);
} else if (!empty($HTTP_GET_VARS)) {
extract($HTTP_GET_VARS);
}

if (!empty($_POST)) {
extract($_POST);
} else if (!empty($HTTP_POST_VARS)) {
extract($HTTP_POST_VARS);
}
include('config.php');

if($go=="yes")
{
    echo "<center><h3>Installing...</h3></center>";
    $dbi = mysql_connect($db_host, $db_username, $db_pass);
    mysql_select_db("$db_name",$dbi);
    echo "<center><font face=\"monospace\">Creating Main Cam Table <b>".$prefix."_cams</b>...</font></center>";
    $sql = 'CREATE TABLE ';
    $sql .=    $prefix;
    $sql .= '_cams( camname varchar( 60 ) NOT NULL default \'\', email varchar( 255 ) NOT NULL default \'\', camurl varchar( 255 ) NOT NULL default \'\', url varchar( 255 ) NOT NULL default \'\', id int( 11 ) NOT NULL default \'\'auto_increment, noupdate tinyint( 11 ) NOT NULL default \'0\', PRIMARY KEY ( id ) ) TYPE = MYISAM ';     
    $result = mysql_query($sql);
    if(!$result){echo "<center><font color=\"red\" face=\"monospace\">Error!</font></center><br><br>\n\n";die();}
    else {echo "<center><font color=\"blue\" face=\"monospace\">Success!</font></center><br><br>\n\n";}

    echo "<center><font face=\"monospace\">Creating Temp Cam Table <b>".$prefix."_cams_temp</b>...</font></center>";
    $sql = 'CREATE TABLE ';
    $sql .=    $prefix;
    $sql .= '_cams_temp(camname varchar(60) NOT NULL default \'\', email varchar(255) NOT NULL default \'\', camurl varchar(255) NOT NULL default \'\', url varchar(255) NOT NULL default \'\' ) TYPE=MyISAM ';     
    $result = mysql_query($sql);
    if(!$result){echo "<center><font color=\"red\" face=\"monospace\">Error!</font></center><br><br>\n\n";die();}
    else {echo "<center><font color=\"blue\" face=\"monospace\">Success!</font></center><br><br>\n\n";}
    # Start Delete Install and Redirect#
    echo "<center><font face=\"verdana\" size=\"3\"><b>Deleting File:</b> \"install.php\"</font></center><p>";
    echo "<center><font face=\"verdana\" size=\"2\" color=\"green\">";
    $delete = unlink("install.php");
    if($delete){
    echo "<center><b>Setup file deleted!</b></font></center>";
     }
    else{
    echo "<center><b>Unable to delete Setup file (install.php) go and delete the set up file manually!</b></center></font>";
}

   echo "<p><center><font face=\"verdana\" size=\"3\" color=\"darkblue\"><b>Redirecting you in 30 seconds...</b></center></font>";
   echo "<META HTTP-EQUIV=Refresh CONTENT=\"30; URL=index.php\">";
   #End Install And Redirect#
    
    echo "<center><font color=\"blue\"Please remove the install file!!You can start to tweak the header, and set up any other configuration details you'd like.</font></center><br>\n";
    
    echo"<center><a href=\"admin/index.php\">Admin Area</a></center><br>";
    echo"<center><a href=\"/portal/index.php\">Cam Portal</a></center>";
}

else
{

}

?>



#4 Prismatic

Prismatic
  • Members
  • PipPipPip
  • Advanced Member
  • 503 posts
  • LocationSan Diego

Posted 20 May 2006 - 01:31 AM

Is it giving you any error messages?

#5 mark_wi

mark_wi
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 20 May 2006 - 07:35 AM

I get the following message

Creating Main Cam Table phpcamportal_cams...
Error!

#6 mark_wi

mark_wi
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 20 May 2006 - 08:31 AM

Im looking over and over and over the problem seems to be in making the first table.When I remove that part it will install to the temp table.

this is the first table..

echo "<font face=\"monospace\">Creating Main Cam Table <b>".$prefix."_cams</b>...</font>";
    $sql = 'CREATE TABLE ';
    $sql .=    $prefix;
    $sql .= '_cams( camname varchar( 60 ) NOT NULL default \'\', email varchar( 255 ) NOT NULL default \'\', camurl varchar( 255 ) NOT NULL default \'\', url varchar( 255 ) NOT NULL default \'\', id int( 11 ) NOT NULL default \'\'auto_increment, noupdate tinyint( 11 ) NOT NULL default \'0\', PRIMARY KEY ( id ) ) TYPE = MYISAM ';     
    $result = mysql_query($sql);
    if(!$result){echo "<font color=\"red\" face=\"monospace\">Error!</font><br><br>\n\n";die();}
    else {echo "<font color=\"green\" face=\"monospace\">Success!</font><br><br>\n\n";}


#7 mark_wi

mark_wi
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 21 May 2006 - 05:04 PM

I got it going again.

Thanks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users