Foros del Web » Programando para Internet » PHP »

[AYUDA] MySQL server version

Estas en el tema de [AYUDA] MySQL server version en el foro de PHP en Foros del Web. Saludos, tengo un problema y es q hice un listado de productos el cual llama a una base de datos .. al probarlo de manera ...
  #1 (permalink)  
Antiguo 16/11/2007, 13:06
Avatar de T4ke0veR  
Fecha de Ingreso: agosto-2007
Ubicación: Quito - Ecuador
Mensajes: 1.720
Antigüedad: 16 años, 7 meses
Puntos: 28
[AYUDA] MySQL server version

Saludos, tengo un problema y es q hice un listado de productos el cual llama a una base de datos .. al probarlo de manera local funciona perfecto.. pero al subirlo a la web da el siguiente error...

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

Alguien podria ayudarme? aqui les dejo el codigo
Código PHP:
<?php require_once('Connections/listproduc.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$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;
}
}

mysql_select_db($database_listproduc$listproduc);
$query_Recordset1 "SELECT * FROM categoria WHERE id_marca = 0";
$Recordset1 mysql_query($query_Recordset1$listproduc) or die(mysql_error());
$row_Recordset1 mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 mysql_num_rows($Recordset1);

mysql_select_db($database_listproduc$listproduc);
$query_Recordset7 "SELECT * FROM categoria WHERE id_marca = 1";
$Recordset7 mysql_query($query_Recordset7$listproduc) or die(mysql_error());
$row_Recordset7 mysql_fetch_assoc($Recordset7);
$totalRows_Recordset7 mysql_num_rows($Recordset7);

mysql_select_db($database_listproduc$listproduc);
$query_Recordset8 "SELECT * FROM producto WHERE PKIDCAT =".$row_Recordset1['PKID'];
$Recordset8 mysql_query($query_Recordset8$listproduc) or die(mysql_error());
$row_Recordset8 mysql_fetch_assoc($Recordset8);
$totalRows_Recordset8 mysql_num_rows($Recordset8);
?>

  <p>jdhehdfhekdhke</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <th scope="col">&nbsp;</th>
  </tr>
  <tr>
    <th scope="col"><?php do { ?>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="5%">&nbsp;</td>
      <td colspan="2" class="tituloPROD"><?php 

      
      
echo $row_Recordset1['nombre']; ?>        </td>
    </tr>
   <?php mysql_select_db($database_listproduc$listproduc);
        
$query_Recordset2 "SELECT * FROM producto WHERE PKIDCAT =".$row_Recordset1['PKID'];
        
$Recordset2 mysql_query($query_Recordset2$listproduc) or die(mysql_error());
        
        
$totalRows_Recordset2 mysql_num_rows($Recordset2);
        
        while(
$prod=mysql_fetch_assoc($Recordset2)){?>

        
        <tr>
            <td>&nbsp;</td>
            <td width="8%">&nbsp;</td>
          <td width="87%" colspan="2" class="descPROD">
        <a href="ficha_productos.php?PKID=<?php echo $prod['PKID']; ?>"><?php echo $prod['nombre']; }?>  </a></td>    
    </tr>       
  </table>
  <?php } while ($row_Recordset1 mysql_fetch_assoc($Recordset1)); ?>&nbsp;</th>
  </tr>
  <tr>
    <th scope="col">&nbsp;</th>
  </tr>
</table>
  

  <p>&nbsp;</p>
<?php do { ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <th width="5%" scope="col">&nbsp;</th>
        <th colspan="2" scope="col"><div align="left"><?php echo $row_Recordset7['nombre']; ?></div></th>
    </tr>
     <?php mysql_select_db($database_listproduc$listproduc);
        
$query_Recordset8 "SELECT * FROM producto WHERE PKIDCAT =".$row_Recordset7['PKID'];
        
$Recordset8 mysql_query($query_Recordset8$listproduc) or die(mysql_error());
        
        
$totalRows_Recordset8 mysql_num_rows($Recordset8);
        
        while(
$produc=mysql_fetch_assoc($Recordset8)){?>
      <tr>
        <th scope="row">&nbsp;</th>
        <td width="8%" scope="row">&nbsp;</td>
        <td width="87%" scope="row"><a href="ficha_productos.php?PKID=<?php echo $prod['PKID']; ?>"><?php echo $produc['nombre']; }?>  </a></td>
    </tr>
  </table>
  <?php } while ($row_Recordset7 mysql_fetch_assoc($Recordset7)); ?><p>
    <?php
mysql_free_result
($Recordset1);

mysql_free_result($Recordset7);

mysql_free_result($Recordset8);
?>
</p>
  <p>ifhefhr</p>
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 08:45.