Foros del Web » Programando para Internet » PHP »

Fatal error: Call to undefined function

Estas en el tema de Fatal error: Call to undefined function en el foro de PHP en Foros del Web. hola chicos, miren tengo este problema y la verdad me tiene ya algo mosca, como dice el enunciado me aparece esto SCREAM : Error suppression ...
  #1 (permalink)  
Antiguo 17/11/2014, 17:01
 
Fecha de Ingreso: noviembre-2014
Mensajes: 60
Antigüedad: 9 años, 5 meses
Puntos: 0
Fatal error: Call to undefined function

hola chicos, miren tengo este problema y la verdad me tiene ya algo mosca, como dice el enunciado me aparece esto SCREAM : Error suppression ignored for
Fatal error: call undefined function MySQLDateToDateDIA() in C:\wamp\www\mitienda\preguntas-frecuentes.php on line 103
lo cuerioso es que cuando no tengo puesto el MySQLDateToDateDIA la pagina corre bien, os pongo ambos codigos, porque uno llam al otro, os poongo el codigo y marco con negrita el error,

Código PHP:
Ver original
  1. <?php require_once('Connections/conexioncolegio.php'); ?>
  2. <?php
  3. if (!function_exists("GetSQLValueString")) {
  4. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  5. {
  6.   if (PHP_VERSION < 6) {
  7.     $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  8.   }
  9.  
  10.   $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  11.  
  12.   switch ($theType) {
  13.     case "text":
  14.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  15.       break;    
  16.     case "long":
  17.     case "int":
  18.       $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  19.       break;
  20.     case "double":
  21.       $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  22.       break;
  23.     case "date":
  24.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  25.       break;
  26.     case "defined":
  27.       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  28.       break;
  29.   }
  30.   return $theValue;
  31. }
  32. }
  33.  
  34. mysql_select_db($database_conexioncolegio, $conexioncolegio);
  35. $query_DatosFrecuente = "SELECT * FROM tblfrecuentes WHERE tblfrecuentes.intEstado = 1 ORDER BY tblfrecuentes.fchFecha DESC";
  36. $DatosFrecuente = mysql_query($query_DatosFrecuente, $conexioncolegio) or die(mysql_error());
  37. $row_DatosFrecuente = mysql_fetch_assoc($DatosFrecuente);
  38. $totalRows_DatosFrecuente = mysql_num_rows($DatosFrecuente);
  39. ?>
  40. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  41. <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/Principal.dwt.php" codeOutsideHTMLIsLocked="false" -->
  42. <head>
  43. <link href='http://fonts.googleapis.com/css?family=Roboto+Condensed:400,300' rel='stylesheet' type='text/css'>
  44. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  45. <!-- InstanceBeginEditable name="doctitle" -->
  46. <title>Web de ejemplo de un Colegio</title>
  47. <!-- InstanceEndEditable -->
  48. <!-- InstanceBeginEditable name="head" -->
  49. <!-- InstanceEndEditable -->
  50. <link href="css/principal.css" rel="stylesheet" type="text/css" />
  51. <?php include("includes/header.php"); ?>
  52. </head>
  53.  
  54. <body>
  55. <?php include("includes/afterbody.php"); ?>
  56.  
  57. <div class="container">
  58.   <div class="header"><?php include("includes/cabecera.php"); ?></div>
  59.   <div class="sidebar1"><?php include("includes/menuizquierda.php"); ?>
  60.   </div>
  61.   <div class="content"><!-- InstanceBeginEditable name="Contenido" -->
  62.  
  63.  
  64. <script>
  65. function validateformpregunta()
  66. {
  67.     valid = true;
  68.     $("#aviso1").hide("slow");
  69.     document.formfrecuente.strTexto.style.border='1px solid #13659e';
  70.     //COLORES
  71.     if (document.formfrecuente.strTexto.value == ""){
  72.         $("#aviso1").show("slow");
  73.         document.formfrecuente.strTexto.style.border='1px solid red';
  74.         valid = false;
  75.     }
  76.     return valid;
  77. }
  78. </script>
  79.   <h1>Preguntas frecuentes
  80.    
  81.    
  82.   </h1><form action="" method="post" name="formfrecuente" id="formfrecuente">
  83.       <table align="center">
  84.         <tr valign="baseline">
  85.           <td nowrap="nowrap" align="right">Pregunta:</td>
  86.           <td><input name="strTexto" type="text" class="campo" value="" size="32" />
  87.           <div class="capaerrores" id="aviso1">Debes escribir una pregunta.</div>
  88.           <div class="capaexito" id="exito1">Tu mensaje está en la cola de moderación y será respondido en breve.</div></td>
  89.         </tr>
  90.         <tr valign="baseline">
  91.           <td nowrap="nowrap" align="right">&nbsp;</td>
  92.           <td><input type="button" class="boton" value="Realizar pregunta" id="botoninsertar" /></td>
  93.         </tr>
  94.       </table>
  95.       <input type="hidden" name="MM_insert" value="form1" />
  96.      
  97.   </form>
  98.   <?php
  99.    $contador=1;
  100.    do
  101.    { ?>
  102.   <div class="capafrecuentes">
  103.   <span class="span"> Enviado</span><?php echo [B]MySQLDateToDateDIA[/B]($row_DatosFrecuente['fchFecha']);?><span class="span1">A las</span><?php echo [B]MySQLDateToDateHORA[/B]($row_DatosFrecuente['fchFecha']);?><br />
  104.  <a id="lateralmyHeader<?php echo $contador; ?>" href="javascript:lateralshowonlyone('lateralnewboxes<?php echo $contador; ?>');"> <?php echo utf8_encode($row_DatosFrecuente['strTexto']);?></a><br /> <div class="lateralnewboxes" id="lateralnewboxes<?php echo $contador; ?>" style="display:none;">
  105.   <?php echo $row_DatosFrecuente['strRespuesta']; ?></div>
  106.     </div>
  107.     <?php
  108.      $contador++;
  109.      } while ($row_DatosFrecuente = mysql_fetch_assoc($DatosFrecuente)); ?>
  110.   <!-- InstanceEndEditable --></div>
  111.   <div class="footer">
  112.     <?php include("includes/pie.php"); ?>
  113.   <!-- end .footer --></div>
  114.   <!-- end .container --></div>
  115. </body>
  116. <!-- InstanceEnd -->
  117. <script type="text/javascript">
  118.  
  119.  
  120.  
  121. $('#botoninsertar').click(function (){
  122. $("#exito1").hide("fast");
  123. if (validateformpregunta())
  124.     {  
  125.     var preguntatexto = document.formfrecuente.strTexto.value;
  126.     $.ajax({
  127.         type: "POST",
  128.         url:"includes/funciones-ajax.php",
  129.         data: 'strTexto='+preguntatexto,
  130.         success: function(resp)
  131.         {  
  132.             if (resp==1)
  133.             {
  134.                  $("#exito1").show("slow");
  135.                  document.formfrecuente.strTexto.value="";
  136.             }
  137.         }
  138.         });
  139.     }
  140. });
  141.  
  142. </script>
  143. <script>
  144. function lateralshowonlyone(thechosenone) {
  145.      $('.lateralnewboxes').each(function(index) {
  146.           if ($(this).attr("id") == thechosenone) {
  147.                $(this).show(200);
  148.           }
  149.           else {
  150.                $(this).hide(600);
  151.           }
  152.      });
  153. }
  154. </script>
  155.  
  156. </html>
  157. <?php
  158. mysql_free_result($DatosFrecuente);
  159. ?>

aqui a la funcion que es llamada

Código PHP:
Ver original
  1. <?php
  2.  
  3. function DateToQuotedMySQLDate($Fecha)
  4. {
  5. $Parte1 = substr($Fecha, 0, 10);
  6. $Parte2 = substr($Fecha, 10, 18);
  7.  
  8. if ($Parte1<>""){
  9.    $trozos=explode("/",$Parte1,3);
  10.    return $trozos[2]."-".$trozos[1]."-".$trozos[0].$Parte2; }
  11. else
  12.    {return "NULL";}
  13. }
  14.  
  15. function [B]MySQLDateToDateHORA[/B]($MySQLFecha)
  16. {
  17. if (($MySQLFecha == "") or ($MySQLFecha == "0000-00-00") )
  18.     {return "";}
  19. else
  20.     {return date("H:i",strtotime($MySQLFecha));}
  21. }
  22.  
  23. function[B] MySQLDateToDateDIA[/B]($MySQLFecha)
  24. {
  25. if (($MySQLFecha == "") or ($MySQLFecha == "0000-00-00") )
  26.     {return "";}
  27. else
  28.     {return date("d/m/Y",strtotime($MySQLFecha));}
  29. }
  30. ?>
a ver si doy con ese error, gracias
  #2 (permalink)  
Antiguo 18/11/2014, 05:58
Avatar de GeekGirl  
Fecha de Ingreso: julio-2014
Mensajes: 423
Antigüedad: 9 años, 9 meses
Puntos: 44
Respuesta: Fatal error: Call to undefined function

Borrarlo por favor, no leí con atención
  #3 (permalink)  
Antiguo 18/11/2014, 08:22
 
Fecha de Ingreso: noviembre-2014
Mensajes: 60
Antigüedad: 9 años, 5 meses
Puntos: 0
Respuesta: Fatal error: Call to undefined function

ya esta arreglado, se me olvido llamar a al funcion desde conexiones, podeis dar por cerrado

Etiquetas: call, fatal, fecha, function, html, mysql, select, sql, undefined
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:57.