Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
Donovan
Client



Joined: Oct 07, 2003
Posts: 735
Location: Ohio

PostPosted: Fri Jun 09, 2006 2:53 pm Reply with quote

If it is not one thing it is another.

Quote:
Error performing query: Lost connection to MySQL server during query.


This was working before.

*sigh*


Code:
<?php

/************************************************************************/
/* MILPACS (Military Personell and Classification System)               */
/* Author::Donovan [3rd ID]                                    */
/* Copyright (c) 2005 by Steven Donovan AKA Donovan [3rd ID]         */
/* Email:: donovan@3rd-infantry-division.net
/* Homepage::http://www.3rd-infantry-division.net                  */
/*                                                      */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/*                                                                      */
/* This program is distributed in the hope that it will be useful, but  */
/* WITHOUT ANY WARRANTY; without even the implied warranty of           */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU     */
/* General Public License for more details.                             */
/*                                                                      */
/* If you want a copy of the GNU General Public License write to the    */
/* Free Software Foundation, Inc.                              */
/* 59 Temple Place, Suite 330, Boston, MA 02111-1307               */
/* USA                                                                  */
/************************************************************************/

/*********************************************************/
/* Add Unit                                              */
/*********************************************************/

if (!defined('ADMIN_FILE')) {
die ("Access Denied");
}

define('INDEX_FILE', true);
$index = 1;
include_once("header.php");
global $module_name, $db, $prefix, $admin_file, $bgcolor1, $bgcolor2;
$IMAGEPATH = $_SERVER['DOCUMENT_ROOT'];

// Add values to unit table   

if ($op == "NewUnit") {

      $unit_name = $_POST['unit_name'];
      $unit_order = $_POST['unit_order'];
      $unit_image = $_POST['unit_image'];   
      $unit_nick = $_POST['unit_nick'];
      $unit_creed = addslashes($_POST['unit_creed']);
      $unit_motto = addslashes($_POST['unit_motto']);
      $unit_goal_one = addslashes($_POST['unit_goal_one']);
      $unit_goal_two = addslashes($_POST['unit_goal_two']);
      $unit_goal_three = addslashes($_POST['unit_goal_three']);
      $unit_bio = addslashes($_POST['unit_bio']);   
      
      //Insert the values into the units table
   $sql = "INSERT INTO " . $prefix . "_milpacs_units (unit_id, unit_name, unit_order, unit_image, unit_nick, unit_creed, unit_motto, unit_goal_one, unit_goal_two, unit_goal_three, unit_bio)". "VALUES ('NULL','$unit_name','$unit_order','$unit_image','$unit_nick', '$unit_creed', '$unit_motto', '$unit_goal_one', '$unit_goal_two', '$unit_goal_three', '$unit_bio')";
      $result = $db->sql_query($sql);
      if (!$result) {
      echo("<p>Error performing query: " . mysql_error() . "</p>");
      }
}

      // Load Unit image
$urlofimages="$IMAGEPATH/modules/MILPACS/images/units/";
$unitselecthtml = "<select name=\"unit_image\">";
$unitselecthtml .= "<option value=\"\">Select Unit Image</option>";
if ($handle=@opendir($urlofimages)) {
   while ($imgfile = readdir($handle)) {
      if ($imgfile != "." && $imgfile != ".." && $imgfile != "" && $imgfile != "index.html" && $imgfile != "WS_FTP.LOG" && $imgfile != "Thumbs.db") {
         if ($imgfile==$unit_image) {
            $unitselecthtml .= "<option value =\"$imgfile\" selected>$imgfile</option>";
         } else {
            $unitselecthtml .= "<option value =\"$imgfile\" >$imgfile</option>";
         }
      }
   }
   @closedir($handle);
}
$unitselecthtml .= "</select></td>";
OpenTable();
echo "<p><a href=\"admin.php?op=milpacs\">Return to Main Administration</a></p>";
echo "<form name=\"addunit\" action=\"".$admin_file.".php\" method=\"post\">";
?>
<table border="2" cellpadding="2" align="center" cellspacing="0" style="border-collapse: collapse;" bordercolor="#111111" width="100%">
      <tr>
         <td align="center" bgcolor= "<?php echo $bgcolor2 ?>"> Unit Name: <input type="text" name="unit_name" value="<?php echo $unit_name ?>"></td>
      </tr>         
      <tr>
         <td align="center" bgcolor= "<?php echo $bgcolor2 ?>"> Unit Image: <?php echo $unitselecthtml ?></td>
      </tr>
      <tr>
         <td align="center" bgcolor= "<?php echo $bgcolor2 ?>"> Unit Call Sign: <input type="text" name="unit_nick" value="<?php echo $unit_nick ?>"></td>
       </tr>
      <tr>
       <td align="center" bgcolor= "<?php echo $bgcolor2 ?>"> Unit Order: <input type="text" name="unit_order" value="<?php echo $unit_order ?>"></td>
      </tr>
      <br>
      <tr>
         <td align="center" bgcolor= "<?php echo $bgcolor2 ?>"><b><font class="content">Unit Creed</font></b></td>
      </tr>
      <tr>
         <td align="center" bgcolor= "<?php echo $bgcolor2 ?>"><textarea name="unit_creed" cols="130" colspan="1" rows="4"> <?php echo $unit_creed ?> </textarea></td>
      </tr>
      <tr>
      <tr>
         <td align="center" bgcolor= "<?php echo $bgcolor2 ?>"><b><font class="content">Unit Motto</font></b></td>
      </tr>
      <tr>
         <td align="center" bgcolor= "<?php echo $bgcolor2 ?>"><textarea name="unit_motto" cols="130" colspan="1" rows="4"> <?php echo $unit_motto ?> </textarea></td>
      </tr>
      <tr>
         <td align="center" bgcolor= "<?php echo $bgcolor2 ?>"><b><font class="content">Unit Goals</font></b></td>
      </tr>
      <tr>
         <td align="center" bgcolor= "<?php echo $bgcolor2 ?>"><textarea name="unit_goal_one" cols="130" colspan="1" rows="2"> <?php echo $unit_goal_one ?> </textarea></td>
      </tr>
      <tr>
         <td align="center" bgcolor= "<?php echo $bgcolor2 ?>"><textarea name="unit_goal_two" cols="130" colspan="1" rows="2"> <?php echo $unit_goal_two ?> </textarea></td>
      </tr>
      <tr>
         <td align="center" bgcolor= "<?php echo $bgcolor2 ?>"><textarea name="unit_goal_three" cols="130" colspan="1" rows="2"> <?php echo $unit_goal_three ?> </textarea></td>
      </tr>
      <tr>
         <td align="center" bgcolor= "<?php echo $bgcolor2 ?>"><b><font class="content">Unit Bio</font></b></td>
      </tr>
      <tr>
         <td align="center" bgcolor= "<?php echo $bgcolor2 ?>"><textarea name="unit_bio" cols="130" colspan="1" rows="4"> <?php echo $unit_bio ?> </textarea></td>
      </tr>
      </table>      
<br>
<input type="hidden" name="op" value="NewUnit"/>
<input type="hidden" name="id" value="$id"/>
<input type="submit" align="center" name="Submit" value="Add"/>
</form>
<?php
CloseTable();   
?>
 
View user's profile Send private message Visit poster's website ICQ Number
hitwalker
Sells PC To Pay For Divorce



Joined:
Posts: 5661

PostPosted: Fri Jun 09, 2006 4:37 pm Reply with quote

hi..
maybe this helps a bit..

http://bugs.mysql.com/bug.php?id=5588
 
View user's profile Send private message
Donovan







PostPosted: Sat Jun 10, 2006 7:24 am Reply with quote

No this script was working before Raven upgraded PHP, MySQL and other stuff.

On my main site everything was working. I just realized it wasn't any longer when I was fixing things on my development site.
 
hitwalker







PostPosted: Sat Jun 10, 2006 7:52 am Reply with quote

ah...if raven hosts your sites then just send a pm...
im sure he has an answer to this..
 
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6437

PostPosted: Sat Jun 10, 2006 3:47 pm Reply with quote

I had the same problem with my forums similar topics addon - I had to disable it. The problem had to do with a fulltext index. Not resolved AFAIK.

_________________
I search, therefore I exist...
Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message
Donovan







PostPosted: Sun Jun 11, 2006 7:18 pm Reply with quote

kguske wrote:
The problem had to do with a fulltext index. Not resolved AFAIK.


That was it. I took off the fulltext index on the table and it is fixed.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©