Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Danilopupo22

Erro a mandar site pra Hospedagem

Recommended Posts

Gente Por favor me ajudem criei um site no Dreamweaver Cs4 pela ferramenta develox toobox (não sei se escrevi direito)e no servidor local funciona lindamente belo,porem ao mandar pro meu servidor de hospedagem da erro não consigo de geito nenhum fazer funcionar...na verdade eu peguei o script pronto de um blog e instalei e apenas fui adaptando coisas nele,ai fiz um sistema de Elenco pois o Site é de um Clube de futebol e esse sistema de elenco fiz no Dreamweaver e ele não roda o Cadastro e nem o Editar...vou postar os erros pra vocês verem ...

Warning: mysql_select_db() expects parameter 2 to be resource, object given in /home/u243671848/public_html/admin/includes/common/lib/db/KT_Connection.class.phpon line 71

Warning: mysql_error() expects parameter 1 to be resource, object given in /home/u243671848/public_html/admin/includes/common/lib/db/KT_Connection.class.php on line 105

segue abaixo os arquivos cadastrar_jogador.php, Arquivo Editar_jogador.php e o arquivo KT_Connection.class.php

 

este abaixo é o arquivo cadastrar_jogador

<?php require_once('../includes/Config.php'); ?>
<?php
//MX Widgets3 include
require_once('../includes/wdg/WDG.php');

// Load the common classes
require_once('../includes/common/KT_common.php');

// Load the tNG classes
require_once('../includes/tng/tNG.inc.php');

// Load the KT_back class
require_once('../includes/nxt/KT_back.php');

// Make a transaction dispatcher instance
$tNGs = new tNG_dispatcher("");

// Make unified connection variable
$conn_u243671848_urso = new KT_connection($u243671848_urso, $database_u243671848_urso);

// Start trigger
$formValidation = new tNG_FormValidation();
$tNGs->prepareValidation($formValidation);
// End trigger

//start Trigger_FileDelete trigger
//remove this line if you want to edit the code by hand 
function Trigger_FileDelete(&$tNG) {
  $deleteObj = new tNG_FileDelete($tNG);
  $deleteObj->setFolder("imagem/");
  $deleteObj->setDbFieldName("foto_atleta");
  return $deleteObj->Execute();
}
//end Trigger_FileDelete trigger

//start Trigger_ImageUpload trigger
//remove this line if you want to edit the code by hand 
function Trigger_ImageUpload(&$tNG) {
  $uploadObj = new tNG_ImageUpload($tNG);
  $uploadObj->setFormFieldName("foto_atleta");
  $uploadObj->setDbFieldName("foto_atleta");
  $uploadObj->setFolder("imagem/");
  $uploadObj->setResize("true", 180, 211);
  $uploadObj->setMaxSize(1500);
  $uploadObj->setAllowedExtensions("gif, jpg, jpe, jpeg, png");
  $uploadObj->setRename("auto");
  return $uploadObj->Execute();
}
//end Trigger_ImageUpload trigger

// Make an insert transaction instance
$ins_elenco = new tNG_multipleInsert($conn_u243671848_urso);
$tNGs->addTransaction($ins_elenco);
// Register triggers
$ins_elenco->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");
$ins_elenco->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
$ins_elenco->registerTrigger("END", "Trigger_Default_Redirect", 99, "includes/nxt/back.php");
$ins_elenco->registerTrigger("AFTER", "Trigger_ImageUpload", 97);
// Add columns
$ins_elenco->setTable("elenco");
$ins_elenco->addColumn("nome_atleta", "STRING_TYPE", "POST", "nome_atleta");
$ins_elenco->addColumn("nascimento", "STRING_TYPE", "POST", "nascimento");
$ins_elenco->addColumn("ondeatual", "STRING_TYPE", "POST", "ondeatual");
$ins_elenco->addColumn("foto_atleta", "FILE_TYPE", "FILES", "foto_atleta");
$ins_elenco->addColumn("historia", "STRING_TYPE", "POST", "historia");
$ins_elenco->setPrimaryKey("id", "NUMERIC_TYPE");

// Make an update transaction instance
$upd_elenco = new tNG_multipleUpdate($conn_u243671848_urso);
$tNGs->addTransaction($upd_elenco);
// Register triggers
$upd_elenco->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Update1");
$upd_elenco->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
$upd_elenco->registerTrigger("END", "Trigger_Default_Redirect", 99, "includes/nxt/back.php");
$upd_elenco->registerTrigger("AFTER", "Trigger_ImageUpload", 97);
// Add columns
$upd_elenco->setTable("elenco");
$upd_elenco->addColumn("nome_atleta", "STRING_TYPE", "POST", "nome_atleta");
$upd_elenco->addColumn("nascimento", "STRING_TYPE", "POST", "nascimento");
$upd_elenco->addColumn("ondeatual", "STRING_TYPE", "POST", "ondeatual");
$upd_elenco->addColumn("foto_atleta", "FILE_TYPE", "FILES", "foto_atleta");
$upd_elenco->addColumn("historia", "STRING_TYPE", "POST", "historia");
$upd_elenco->setPrimaryKey("id", "NUMERIC_TYPE", "GET", "id");

// Make an instance of the transaction object
$del_elenco = new tNG_multipleDelete($conn_u243671848_urso);
$tNGs->addTransaction($del_elenco);
// Register triggers
$del_elenco->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Delete1");
$del_elenco->registerTrigger("END", "Trigger_Default_Redirect", 99, "includes/nxt/back.php");
$del_elenco->registerTrigger("AFTER", "Trigger_FileDelete", 98);
// Add columns
$del_elenco->setTable("elenco");
$del_elenco->setPrimaryKey("id", "NUMERIC_TYPE", "GET", "id");

// Execute all the registered transactions
$tNGs->executeTransactions();

// Get the transaction recordset
$rselenco = $tNGs->getRecordset("elenco");
$row_rselenco = mysql_fetch_assoc($rselenco);
$totalRows_rselenco = mysql_num_rows($rselenco);
?>
<!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" xmlns:wdg="http://ns.adobe.com/addt">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="../includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
<script src="../includes/common/js/base.js" type="text/javascript"></script>
<script src="../includes/common/js/utility.js" type="text/javascript"></script>
<script src="../includes/skins/style.js" type="text/javascript"></script>
<?php echo $tNGs->displayValidationRules();?>
<script src="../includes/nxt/scripts/form.js" type="text/javascript"></script>
<script src="../includes/nxt/scripts/form.js.php" type="text/javascript"></script>
<script type="text/javascript">
$NXT_FORM_SETTINGS = {
  duplicate_buttons: false,
  show_as_grid: true,
  merge_down_value: true
}
</script>
<script type="text/javascript" src="../includes/common/js/sigslot_core.js"></script>
<script type="text/javascript" src="../includes/wdg/classes/MXWidgets.js"></script>
<script type="text/javascript" src="../includes/wdg/classes/MXWidgets.js.php"></script>
<script type="text/javascript" src="../includes/wdg/classes/Calendar.js"></script>
<script type="text/javascript" src="../includes/wdg/classes/SmartDate.js"></script>
<script type="text/javascript" src="../includes/wdg/calendar/calendar_stripped.js"></script>
<script type="text/javascript" src="../includes/wdg/calendar/calendar-setup_stripped.js"></script>
<script src="includes/resources/calendar.js"></script>
</head>

<body>
<?php
	echo $tNGs->getErrorMsg();
?>
<div class="KT_tng">
  <h1>
    <?php 
// Show IF Conditional region1 
if (@$_GET['id'] == "") {
?>
      <?php echo NXT_getResource("Insert_FH"); ?>
      <?php 
// else Conditional region1
} else { ?>
      <?php echo NXT_getResource("Update_FH"); ?>
      <?php } 
// endif Conditional region1
?>
    Elenco </h1>
  <div class="KT_tngform">
    <form method="post" id="form1" action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>" enctype="multipart/form-data">
      <?php $cnt1 = 0; ?>
      <?php do { ?>
        <?php $cnt1++; ?>
        <?php 
// Show IF Conditional region1 
if (@$totalRows_rselenco > 1) {
?>
          <h2><?php echo NXT_getResource("Record_FH"); ?> <?php echo $cnt1; ?></h2>
          <?php } 
// endif Conditional region1
?>
        <table cellpadding="2" cellspacing="0" class="KT_tngtable">
          <tr>
            <td class="KT_th"><label for="nome_atleta_<?php echo $cnt1; ?>">Nome do Atleta:</label></td>
            <td><input type="text" name="nome_atleta_<?php echo $cnt1; ?>" id="nome_atleta_<?php echo $cnt1; ?>" value="<?php echo KT_escapeAttribute($row_rselenco['nome_atleta']); ?>" size="32" maxlength="50" />
              <?php echo $tNGs->displayFieldHint("nome_atleta");?> <?php echo $tNGs->displayFieldError("elenco", "nome_atleta", $cnt1); ?></td>
          </tr>
          <tr>
            <td class="KT_th"><label for="nascimento_<?php echo $cnt1; ?>">Nascimento:</label></td>
            <td><input name="nascimento_<?php echo $cnt1; ?>" id="nascimento_<?php echo $cnt1; ?>" value="<?php echo KT_escapeAttribute($row_rselenco['nascimento']); ?>" size="20" maxlength="20" wdg:mondayfirst="false" wdg:subtype="Calendar" wdg:mask="<?php echo $KT_screen_date_format; ?>" wdg:type="widget" wdg:singleclick="false" wdg:restricttomask="no" wdg:readonly="true" />
              <?php echo $tNGs->displayFieldHint("nascimento");?> <?php echo $tNGs->displayFieldError("elenco", "nascimento", $cnt1); ?></td>
          </tr>
          <tr>
            <td class="KT_th"><label for="ondeatual_<?php echo $cnt1; ?>">Posição:</label></td>
            <td><input type="text" name="ondeatual_<?php echo $cnt1; ?>" id="ondeatual_<?php echo $cnt1; ?>" value="<?php echo KT_escapeAttribute($row_rselenco['ondeatual']); ?>" size="30" maxlength="30" />
              <?php echo $tNGs->displayFieldHint("ondeatual");?> <?php echo $tNGs->displayFieldError("elenco", "ondeatual", $cnt1); ?></td>
          </tr>
          <tr>
            <td class="KT_th"><label for="foto_atleta_<?php echo $cnt1; ?>">Foto do Atleta:</label></td>
            <td><input type="file" name="foto_atleta_<?php echo $cnt1; ?>" id="foto_atleta_<?php echo $cnt1; ?>" size="32" />
              <?php echo $tNGs->displayFieldError("elenco", "foto_atleta", $cnt1); ?></td>
          </tr>
          <tr>
            <td class="KT_th"><label for="historia_<?php echo $cnt1; ?>">Curriculum:</label></td>
            <td><textarea name="historia_<?php echo $cnt1; ?>" id="historia_<?php echo $cnt1; ?>" cols="50" rows="5"><?php echo KT_escapeAttribute($row_rselenco['historia']); ?></textarea>
              <?php echo $tNGs->displayFieldHint("historia");?> <?php echo $tNGs->displayFieldError("elenco", "historia", $cnt1); ?></td>
          </tr>
        </table>
        <input type="hidden" name="kt_pk_elenco_<?php echo $cnt1; ?>" class="id_field" value="<?php echo KT_escapeAttribute($row_rselenco['kt_pk_elenco']); ?>" />
        <?php } while ($row_rselenco = mysql_fetch_assoc($rselenco)); ?>
      <div class="KT_bottombuttons">
        <div>
          <?php 
      // Show IF Conditional region1
      if (@$_GET['id'] == "") {
      ?>
            <input type="submit" name="KT_Insert1" id="KT_Insert1" value="<?php echo NXT_getResource("Insert_FB"); ?>" />
            <?php 
      // else Conditional region1
      } else { ?>
            <div class="KT_operations">
              <input type="submit" name="KT_Insert1" value="<?php echo NXT_getResource("Insert as new_FB"); ?>" onclick="nxt_form_insertasnew(this, 'id')" />
            </div>
            <input type="submit" name="KT_Update1" value="<?php echo NXT_getResource("Update_FB"); ?>" />
            <input type="submit" name="KT_Delete1" value="<?php echo NXT_getResource("Delete_FB"); ?>" onclick="return confirm('<?php echo NXT_getResource("Are you sure?"); ?>');" />
            <?php }
      // endif Conditional region1
      ?>
<input type="button" name="KT_Cancel1" value="<?php echo NXT_getResource("Cancel_FB"); ?>" onclick="return UNI_navigateCancel(event, 'includes/nxt/back.php')" />
        </div>
      </div>
    </form>
  </div>
  <br class="clearfixplain" />
</div>
<p> </p>
</body>
</html> 

 

este abaixo é o arquivo editar_jogador

<?php require_once('../includes/Config.php'); ?>
<?php
// Load the common classes
require_once('../includes/common/KT_common.php');

// Load the required classes
require_once('../includes/tfi/TFI.php');
require_once('../includes/tso/TSO.php');
require_once('../includes/nav/NAV.php');

// Make unified connection variable
$conn_cornkick = new KT_connection($u243671848_urso, $database_u243671848_urso);

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

// Filter
$tfi_listelenco2 = new TFI_TableFilter($conn_u243671848_urso, "tfi_listelenco2");
$tfi_listelenco2->addColumn("elenco.nome_atleta", "STRING_TYPE", "nome_atleta", "%");
$tfi_listelenco2->addColumn("elenco.nascimento", "STRING_TYPE", "nascimento", "%");
$tfi_listelenco2->addColumn("elenco.ondeatual", "STRING_TYPE", "ondeatual", "%");
$tfi_listelenco2->addColumn("elenco.foto_atleta", "FILE_TYPE", "foto_atleta", "%");
$tfi_listelenco2->addColumn("elenco.historia", "STRING_TYPE", "historia", "%");
$tfi_listelenco2->Execute();

// Sorter
$tso_listelenco2 = new TSO_TableSorter("rselenco1", "tso_listelenco2");
$tso_listelenco2->addColumn("elenco.nome_atleta");
$tso_listelenco2->addColumn("elenco.nascimento");
$tso_listelenco2->addColumn("elenco.ondeatual");
$tso_listelenco2->addColumn("elenco.foto_atleta");
$tso_listelenco2->addColumn("elenco.historia");
$tso_listelenco2->setDefault("elenco.nome_atleta");
$tso_listelenco2->Execute();

// Navigation
$nav_listelenco2 = new NAV_Regular("nav_listelenco2", "rselenco1", "", $_SERVER['PHP_SELF'], 5);

//NeXTenesio3 Special List Recordset
$maxRows_rselenco1 = $_SESSION['max_rows_nav_listelenco2'];
$pageNum_rselenco1 = 0;
if (isset($_GET['pageNum_rselenco1'])) {
  $pageNum_rselenco1 = $_GET['pageNum_rselenco1'];
}
$startRow_rselenco1 = $pageNum_rselenco1 * $maxRows_rselenco1;

// Defining List Recordset variable
$NXTFilter_rselenco1 = "1=1";
if (isset($_SESSION['filter_tfi_listelenco2'])) {
  $NXTFilter_rselenco1 = $_SESSION['filter_tfi_listelenco2'];
}
// Defining List Recordset variable
$NXTSort_rselenco1 = "elenco.nome_atleta";
if (isset($_SESSION['sorter_tso_listelenco2'])) {
  $NXTSort_rselenco1 = $_SESSION['sorter_tso_listelenco2'];
}
mysql_select_db($database_u243671848_urso, $u243671848_urso);

$query_rselenco1 = "SELECT elenco.nome_atleta, elenco.nascimento, elenco.ondeatual, elenco.foto_atleta, elenco.historia, elenco.id FROM elenco WHERE {$NXTFilter_rselenco1} ORDER BY {$NXTSort_rselenco1}";
$query_limit_rselenco1 = sprintf("%s LIMIT %d, %d", $query_rselenco1, $startRow_rselenco1, $maxRows_rselenco1);
$rselenco1 = mysql_query($query_limit_rselenco1, $u243671848_urso) or die(mysql_error());
$row_rselenco1 = mysql_fetch_assoc($rselenco1);

if (isset($_GET['totalRows_rselenco1'])) {
  $totalRows_rselenco1 = $_GET['totalRows_rselenco1'];
} else {
  $all_rselenco1 = mysql_query($query_rselenco1);
  $totalRows_rselenco1 = mysql_num_rows($all_rselenco1);
}
$totalPages_rselenco1 = ceil($totalRows_rselenco1/$maxRows_rselenco1)-1;
//End NeXTenesio3 Special List Recordset

$nav_listelenco2->checkBoundries();
?>
<!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=utf-8" />
<title>Untitled Document</title>
<link href="includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
<script src="../includes/common/js/base.js" type="text/javascript"></script>
<script src="../includes/common/js/utility.js" type="text/javascript"></script>
<script src="../includes/skins/style.js" type="text/javascript"></script>
<script src="../includes/nxt/scripts/list.js" type="text/javascript"></script>
<script src="../includes/nxt/scripts/list.js.php" type="text/javascript"></script>
<script type="text/javascript">
$NXT_LIST_SETTINGS = {
  duplicate_buttons: false,
  duplicate_navigation: true,
  row_effects: true,
  show_as_buttons: true,
  record_counter: true
}
</script>
<style type="text/css">
  /* Dynamic List row settings */
  .KT_col_nome_atleta {width:140px; overflow:hidden;}
  .KT_col_nascimento {width:140px; overflow:hidden;}
  .KT_col_ondeatual {width:140px; overflow:hidden;}
  .KT_col_foto_atleta {width:140px; overflow:hidden;}
  .KT_col_historia {width:140px; overflow:hidden;}
</style>
</head>

<body>
<div class="KT_tng" id="listelenco2">
  <h1> Elenco
    <?php
  $nav_listelenco2->Prepare();
  require("../includes/nav/NAV_Text_Statistics.inc.php");
?>
  </h1>
  <div class="KT_tnglist">
    <form action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>" method="post" id="form1">
      <div class="KT_options"> <a href="<?php echo $nav_listelenco2->getShowAllLink(); ?>"><?php echo NXT_getResource("Show"); ?>
        <?php 
  // Show IF Conditional region1
  if (@$_GET['show_all_nav_listelenco2'] == 1) {
?>
          <?php echo $_SESSION['default_max_rows_nav_listelenco2']; ?>
          <?php 
  // else Conditional region1
  } else { ?>
          <?php echo NXT_getResource("all"); ?>
          <?php } 
  // endif Conditional region1
?>
<?php echo NXT_getResource("records"); ?></a>  
         
        <?php 
  // Show IF Conditional region2
  if (@$_SESSION['has_filter_tfi_listelenco2'] == 1) {
?>
          <a href="<?php echo $tfi_listelenco2->getResetFilterLink(); ?>"><?php echo NXT_getResource("Reset filter"); ?></a>
          <?php 
  // else Conditional region2
  } else { ?>
          <a href="<?php echo $tfi_listelenco2->getShowFilterLink(); ?>"><?php echo NXT_getResource("Show filter"); ?></a>
          <?php } 
  // endif Conditional region2
?>
      </div>
      <table cellpadding="2" cellspacing="0" class="KT_tngtable">
        <thead>
          <tr class="KT_row_order">
            <th> <input type="checkbox" name="KT_selAll" id="KT_selAll"/>
            </th>
            <th id="nome_atleta" class="KT_sorter KT_col_nome_atleta <?php echo $tso_listelenco2->getSortIcon('elenco.nome_atleta'); ?>"> <a href="<?php echo $tso_listelenco2->getSortLink('elenco.nome_atleta'); ?>">Nome do Atleta</a></th>
            <th id="nascimento" class="KT_sorter KT_col_nascimento <?php echo $tso_listelenco2->getSortIcon('elenco.nascimento'); ?>"> <a href="<?php echo $tso_listelenco2->getSortLink('elenco.nascimento'); ?>">Nascimento</a></th>
            <th id="ondeatual" class="KT_sorter KT_col_ondeatual <?php echo $tso_listelenco2->getSortIcon('elenco.ondeatual'); ?>"> <a href="<?php echo $tso_listelenco2->getSortLink('elenco.ondeatual'); ?>">Posição</a></th>
            <th id="foto_atleta" class="KT_sorter KT_col_foto_atleta <?php echo $tso_listelenco2->getSortIcon('elenco.foto_atleta'); ?>"> <a href="<?php echo $tso_listelenco2->getSortLink('elenco.foto_atleta'); ?>">Foto do Atleta</a></th>
            <th id="historia" class="KT_sorter KT_col_historia <?php echo $tso_listelenco2->getSortIcon('elenco.historia'); ?>"> <a href="<?php echo $tso_listelenco2->getSortLink('elenco.historia'); ?>">Curriculum</a></th>
            <th> </th>
          </tr>
          <?php 
  // Show IF Conditional region3
  if (@$_SESSION['has_filter_tfi_listelenco2'] == 1) {
?>
            <tr class="KT_row_filter">
              <td> </td>
              <td><input type="text" name="tfi_listelenco2_nome_atleta" id="tfi_listelenco2_nome_atleta" value="<?php echo KT_escapeAttribute(@$_SESSION['tfi_listelenco2_nome_atleta']); ?>" size="20" maxlength="50" /></td>
              <td><input type="text" name="tfi_listelenco2_nascimento" id="tfi_listelenco2_nascimento" value="<?php echo KT_escapeAttribute(@$_SESSION['tfi_listelenco2_nascimento']); ?>" size="20" maxlength="20" /></td>
              <td><input type="text" name="tfi_listelenco2_ondeatual" id="tfi_listelenco2_ondeatual" value="<?php echo KT_escapeAttribute(@$_SESSION['tfi_listelenco2_ondeatual']); ?>" size="20" maxlength="30" /></td>
              <td><input type="text" name="tfi_listelenco2_foto_atleta" id="tfi_listelenco2_foto_atleta" value="<?php echo KT_escapeAttribute(@$_SESSION['tfi_listelenco2_foto_atleta']); ?>" size="20" maxlength="50" /></td>
              <td><input type="text" name="tfi_listelenco2_historia" id="tfi_listelenco2_historia" value="<?php echo KT_escapeAttribute(@$_SESSION['tfi_listelenco2_historia']); ?>" size="20" maxlength="100" /></td>
              <td><input type="submit" name="tfi_listelenco2" value="<?php echo NXT_getResource("Filter"); ?>" /></td>
            </tr>
            <?php } 
  // endif Conditional region3
?>
        </thead>
        <tbody>
          <?php if ($totalRows_rselenco1 == 0) { // Show if recordset empty ?>
            <tr>
              <td colspan="7"><?php echo NXT_getResource("The table is empty or the filter you've selected is too restrictive."); ?></td>
            </tr>
            <?php } // Show if recordset empty ?>
          <?php if ($totalRows_rselenco1 > 0) { // Show if recordset not empty ?>
            <?php do { ?>
              <tr class="<?php echo @$cnt1++%2==0 ? "" : "KT_even"; ?>">
                <td><input type="checkbox" name="kt_pk_elenco" class="id_checkbox" value="<?php echo $row_rselenco1['id']; ?>" />
                  <input type="hidden" name="id" class="id_field" value="<?php echo $row_rselenco1['id']; ?>" /></td>
                <td><div class="KT_col_nome_atleta"><?php echo KT_FormatForList($row_rselenco1['nome_atleta'], 20); ?></div></td>
                <td><div class="KT_col_nascimento"><?php echo KT_FormatForList($row_rselenco1['nascimento'], 20); ?></div></td>
                <td><div class="KT_col_ondeatual"><?php echo KT_FormatForList($row_rselenco1['ondeatual'], 20); ?></div></td>
                <td><div class="KT_col_foto_atleta"><?php echo KT_FormatForList($row_rselenco1['foto_atleta'], 20); ?></div></td>
                <td><div class="KT_col_historia"><?php echo KT_FormatForList($row_rselenco1['historia'], 20); ?></div></td>
                <td><a class="KT_edit_link" href="cadastrar_jogador.php?id=<?php echo $row_rselenco1['id']; ?>&KT_back=1"><?php echo NXT_getResource("edit_one"); ?></a> <a class="KT_delete_link" href="#delete"><?php echo NXT_getResource("delete_one"); ?></a></td>
              </tr>
              <?php } while ($row_rselenco1 = mysql_fetch_assoc($rselenco1)); ?>
            <?php } // Show if recordset not empty ?>
        </tbody>
      </table>
      <div class="KT_bottomnav">
        <div>
          <?php
            $nav_listelenco2->Prepare();
            require("../includes/nav/NAV_Text_Navigation.inc.php");
          ?>
        </div>
      </div>
      <div class="KT_bottombuttons">
        <div class="KT_operations"> <a class="KT_edit_op_link" href="#" onclick="nxt_list_edit_link_form(this); return false;"><?php echo NXT_getResource("edit_all"); ?></a> <a class="KT_delete_op_link" href="#" onclick="nxt_list_delete_link_form(this); return false;"><?php echo NXT_getResource("delete_all"); ?></a></div>
        <span> </span>
        <select name="no_new" id="no_new">
          <option value="1">1</option>
          <option value="3">3</option>
          <option value="6">6</option>
        </select>
        <a class="KT_additem_op_link" href="cadastrar_jogador.php?KT_back=1" onclick="return nxt_list_additem(this)"><?php echo NXT_getResource("add new"); ?></a></div>
    </form>
  </div>
  <br class="clearfixplain" />
</div>
<p> </p>
</body>
</html>
<?php
mysql_free_result($rselenco1);
?>
 

 

e este ultimo é o arquivo

KT_Connection.class.php
<?php
/*
 * ADOBE SYSTEMS INCORPORATED
 * Copyright 2007 Adobe Systems Incorporated
 * All Rights Reserved
 * 
 * NOTICE:  Adobe permits you to use, modify, and distribute this file in accordance with the 
 * terms of the Adobe license agreement accompanying it. If you have received this file from a 
 * source other than Adobe, then your use, modification, or distribution of it requires the prior 
 * written permission of Adobe.
 */

/*
	Copyright (c) InterAKT Online 2000-2006. All rights reserved.
*/

/**
 * The connection class (used on PHP - MySQL Server model)
 */
class KT_Connection {

	/**
	 * The database name
	 * @var string
	 * @access private
	 */
	var $databaseName = '';

	/**
	 * The connection Resource ID
	 * @var object ResourceID
	 * @access private
	 */
	var $connection = null;
	
	/**
	 * Flag. what server model is.
	 * @var string
	 * @access private
	 */
	var $servermodel = "mysql";
	
	/**
	 * for ADODB compatibility
	 * @var string
	 * @access public
	 */
	var $databaseType = "mysql";

	/**
	 * The constructor
	 * Sets the connection and the database name
	 * @param object ResourceID &$connection
	 * @param string $databasename
	 * @access public
	 */
	function KT_Connection(&$connection, $databasename) {
		$this->connection = &$connection;
		$this->databaseName = $databasename;
	}

	/**
	 * Executes a SQL statement
	 * @param string $sql
	 * @return object unknown
	 *         true on success
	 *         response Resource ID if one is returned by the wrapper function
	 * @access public
	 */
	function Execute($sql) {
		if (!mysql_select_db($this->databaseName, $this->connection)) {
			return false;
		}			
		$response = mysql_query($sql, $this->connection);
		if (!is_resource($response)) {
			return $response;
		} else {
			$recordset = new KT_Recordset($response);
			return $recordset;
		}
	}

	/**
	 * Executes a SQL statement
	 * @param string $sql
	 * @return mysql resource
	 *         true on success
	 *         response MYSQL Resource ID
	 * @access public
	 */
	function MySQL_Execute($sql) {
		if (!mysql_select_db($this->databaseName, $this->connection)) {
			return false;
		}	
		$response = mysql_query($sql, $this->connection);
		return $response;
	}

	/**
	 * Gets the error message
	 * @return string
	 * @access public
	 */
	function ErrorMsg() {
		return mysql_error($this->connection);
	}

	/**
	 * Gets the auto-generated inserted id (if any)
	 * @return object unknown
	 * @access public
	 */
	function Insert_ID($table, $pKeyCol) {
		return mysql_insert_id($this->connection);
	}
}
?>

 

Cadastrar_jogador

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

tente troca

 

mysql_select_db($database_u243671848_urso, $u243671848_urso);

 

por

 

 

mysql_select_db($database_u243671848_urso) || die('Impossível selecionar o banco de dados');

Compartilhar este post


Link para o post
Compartilhar em outros sites

não existe esse banco de dados tenta coloca,

mysql_select_db(' coloca o nome do banco aqui ') or die('Impossível selecionar o banco de dados');

Compartilhar este post


Link para o post
Compartilhar em outros sites

amigo agora deu este erro

Warning: mysql_select_db() expects parameter 2 to be resource, null given in /home/u243671848/public_html/admin/includes/common/lib/db/KT_Connection.class.php on line 71

Warning: mysql_select_db() expects parameter 2 to be resource, null given in /home/u243671848/public_html/admin/includes/common/lib/db/KT_Connection.class.php on line 71

Warning: mysql_error() expects parameter 1 to be resource, null given in /home/u243671848/public_html/admin/includes/common/lib/db/KT_Connection.class.php on line105

Error:
Internal error.
Developer Details:
tNG_multiple.getFakeRecordset
SQL error: Error creating fake recordset:

SQL:
SELECT '' AS nome_atleta, '' AS nascimento, '' AS ondeatual, '' AS foto_atleta, '' AS historia, '' AS id, 'KT_NEW' AS kt_pk_elenco. (MULTIPLE_FAKE_RS_ERROR)
tNG Execution Trace - VIEW
  • tNG_multipleInsert.executeTransaction
    • STARTER.Trigger_Default_Starter
  • tNG_multipleUpdate.executeTransaction
    • STARTER.Trigger_Default_Starter
  • tNG_multipleDelete.executeTransaction
    • STARTER.Trigger_Default_Starter
  • tNG_multipleInsert.getRecordset
  • tNG_multipleInsert.getFakeRecordset*

Compartilhar este post


Link para o post
Compartilhar em outros sites

Os erros explicam o problema. Você passou null em vez de um tipo resource (retorno de mysql_connect)

É o mesmo problema que descrevo aqui:

http://rberaldo.com.br/as-mensagens-de-erros-mais-comuns-do-php/#mysql_result_resource

 

 

PS: funções mysql_* estão obsoletas desde o PHP 5.5 e serão removidas do PHP em breve. Prefira usar MySQLi ou PDO. Veja mais aqui: http://www.ultimatephp.com.br/php-por-que-nao-utilizar-funcoes-mysql

Compartilhar este post


Link para o post
Compartilhar em outros sites

  • Conteúdo Similar

    • Por landerbadi
      Boa tarde pessoal. Estou tentado fazer uma consulta no banco de dados porém estou tendo dificuldades. Tenho uma tabela chamada "itens" com os seguintes campos: id, item, ativo. Nela tem cadastrado vários itens. No campo ativo eu coloco a letra "S" para informar que este item está ativo no sistema. Por exemplo: 1, casa, S 2, mesa, S 3, cama, S 4, moto S 5, rádio O quinto registro "radio" não está ativo no sistema pois não tem um "S" no campo ativo. E outra tabela chamada "produtos" com os seguintes campos (id, item1, item2, item3) com os seguintes registros: 1, casa, mesa, moto 2, mesa, casa, cama 3, rádio, cama, mesa Eu preciso fazer uma busca na tabela produtos da seguinte maneira: Eu escolho um registro na tabela "itens", por exemplo "mesa". Preciso fazer com que o php me liste todos os registros da tabela "produtos" que contenham a palavra "mesa". Até aqui tudo bem eu consigo listar. Estou fazendo assim: <?php $item = "mesa" $sql = mysqli_query($conn, "SELECT * FROM produtos WHERE item1 LIKE '$item' OR item2 LIKE '$item' OR item3 LIKE '$item' LIMIT 10"); while($aux = mysqli_fetch_assoc($sql)) { $id = $aux["id"]; $item1 = $aux["item1"]; $item2 = $aux["item2"]; $item3 = $aux["item3"]; echo $id . " - " . $item1 . ", " . $item2 . ", " $item3 . "<br>"; } ?> O problema é que está listando todos os registros que contém o item mesa. Eu preciso que o php verifique os demais item e me liste somente os registro em que todos os registros estejam ativos no sistema. No exemplo acima ele não deveria listar o registro 3. pois nesse registro contém o item "radio" e este item não está ativo no sistema. Ou seja, o registro "radio" na tabela itens não possui um "S" na coluna "ativo". Alguém sabe como resolver isso?
    • Por ILR master
      Fala galera.
      Espero que todos estejam bem.
      Seguinte: Tenho um arquivo xml onde alguns campos estão com : (dois pontos), como o exemplo abaixo:
       
      <item>
      <title>
      d sa dsad sad sadasdas
      </title>
      <link>
      dsadas dsa sad asd as dsada
      </link>
      <pubDate>sadasdasdsa as</pubDate>
      <dc:creator>
      d sad sad sa ad as das
      </dc:creator>
      </item>
       
      Meu código:
       
      $link = "noticias.xml"; 
      $xml = simplexml_load_file($link); 
      foreach($xml -> channel as $ite) {     
           $titulo = $ite -> item->title;
           $urltitulo = $ite -> item->link;
           print $urltitulo = $ite -> item->dc:creator;
      } //fim do foreach
      ?>
       
      Esse campo dc:creator eu não consigo ler. Como faço?
       
      Agradeço quem puder me ajudar.
       
      Abs
       
       
    • Por First
      Olá a todos!
       
      Eu estou criando um sistema do zero mas estou encontnrando algumas dificuldades e não estou sabendo resolver, então vim recorrer ajuda de vocês.
      Aqui está todo o meu código: https://github.com/PauloJagata/aprendizado/
       
      Eu fiz um sistema de rotas mas só mostra o conteúdo da '/' não sei porque, quando eu tento acessar o register nada muda.
      E eu também quero que se não estiver liberado na rota mostra o erro de 404, mas quando eu tento acessar um link inválido, nada acontece.
      Alguém pode me ajudar com isso? E se tiver algumas sugestão para melhoria do código também estou aceitando.
       
       
      Desde já, obrigado.
×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.