Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/03/2010, 23:14
Avatar de HiToGoRoShi
HiToGoRoShi
 
Fecha de Ingreso: abril-2008
Mensajes: 849
Antigüedad: 16 años
Puntos: 31
Erro con query

Cita:
Warning: mysql_query() expects parameter 2 to be resource, null given in C:\xampp\htdocs\peruguitar\includes\functions_arti culo.php on line 3
Estoy usando AJAX, y al refrescar mi sitio este me vota error

Aca mi codigo comploet

Código PHP:
Ver original
  1. <?php
  2. //Mostrar los Articulos
  3. $ntc = mysql_query("select * from $tabla[2] limit 1",$cnPortal) or die(mysql_error());
  4. $noticia = mysql_fetch_array($ntc);
  5.  
  6. print $_POST['action']." ".$_POST['articuloID'];
  7. ?>
  8. <table width="100%">
  9.   <tr>
  10.     <td width="33%">
  11.     <table width="100%" cellpadding="5" cellspacing="5" class="articulos">
  12.       <tr>
  13.         <td width="81%"><?php print $noticia['titulo']; ?></td>
  14.         <td width="19%"><?php print $noticia['fecha']; ?></td>
  15.       </tr>
  16.       <tr>
  17.         <td colspan="2"><div class="imgNoticia"><img src="logo.png" alt="" width="100%" height="90" /></div></td>
  18.       </tr>
  19.       <tr style="text-align: justify">
  20.         <td colspan="2"><?php print $noticia['comentario']; ?></td>
  21.       </tr>
  22.       <tr>
  23.         <td>Autor</td>
  24.         <td><?php print $noticia['autor']; ?></td>
  25.       </tr>
  26.       <tr>
  27.         <td>Valoracion:</td>
  28.         <td><?php print $noticia['valoracion']; ?></td>
  29.       </tr>
  30.       <tr>
  31.         <td align="center"><select name="valoracion" id="valoracion">
  32.           <option value="1" selected="selected">(1) No lo veas</option>
  33.           <option value="2">(2) No hay nada interesante</option>
  34.           <option value="3">(3) Es malo, no entres</option>
  35.           <option value="4">(4) Tiene algo interesante</option>
  36.           <option value="5">(5) Pase un buen rato</option>
  37.           <option value="6">(6) Esta interesante</option>
  38.           <option value="7">(7) Vale la pena</option>
  39.           <option value="8">(8) Esta mas que genial</option>
  40.           <option value="9">(9) Una obra de arte</option>
  41.           <option value="10">(10) SIN PALABRAS</option>
  42.         </select>
  43.           <input name="articuloID" id="articuloID" type="hidden" value="<?php print $noticia['id']; ?>" /></td>
  44.         <td><input type="image" src="img/btn/valorar.jpg" value="Traer" onclick="ajax_getContent('includes/functions_articulo.php', 'articuloID='+document.getElementById('articuloID').value + '&action=TRUE', 'articulos');"/></td>
  45.       </tr>
  46.     </table>
  47. </td>
  48.     <td width="33%">&nbsp;</td>
  49.     <td width="33%">&nbsp;</td>
  50.   </tr>
  51. </table>

Osea el error esta en que mi script no puede hacer dos veces la conexion, no entiendo porque.. Por cierto estan en modo TRUE las conexiones porque uso dos base de datos

Una iamgen habla mas...


Última edición por HiToGoRoShi; 09/03/2010 a las 23:32