Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/09/2008, 15:24
txino_2
 
Fecha de Ingreso: agosto-2006
Mensajes: 173
Antigüedad: 17 años, 8 meses
Puntos: 1
¿Es posible hacer esto con Base de datos?

Pille de un post de esta web un javascript para añadir comentarios, que es este

Código PHP:
<script type="text/javascript">
            var 
ns4 = (document.layers)? true:false
            
var ie4 = (document.all)? true:false
            
var ns6 = (document.getElementById && !document.all) ? truefalse;
            var 
coorXcoorY;

            if (
ns6document.addEventListener("mousemove"mouseMovetrue)
            if (
ns4) {document.captureEvents(Event.MOUSEMOVE); document.mousemove mouseMove;}

            function 
mouseMove(e)    {
                if (
ns4||ns6)    {
                    
coorX e.pageX;
                    
coorY e.pageY;
                }
                if (
ie4)    {
                    
coorX event.x;
                    
coorY event.y;
                }
                
coorX += document.body.scrollLeft;
                
coorY += document.body.scrollTop;
                return 
true;
            }

            function 
ini()    {
                if (
ie4)    document.body.onmousemove mouseMove;
            }

            function 
mostrar(dato)    {
                
with(document.getElementById("ayuda"))    {
                    
style.top coorY 10;
                    
style.left coorX 10;
                    
style.visibility "visible";
                }
            }

            function 
ocultar()    {
                
document.getElementById("ayuda").style.visibility "hidden";
            }

            function 
mover()    {
                
with(document.getElementById("ayuda"))    {
                    
style.top coorY 10;
                    
style.left coorX 10;
                }
            }

        
</script> 
Código PHP:
#ayuda {border:1px solid black;visibility:hidden;position:absolute} 

<td bgcolor="#C4D8EC"><div align="center" class="Estilo61" onMouseOver="mostrar('mensaje segundo')"
                onmousemove="mover()"
                onmouseout="ocultar()"> Comentario
                    <div id="ayuda">
                      <table width="20%" border="0">
                        <tr>
                          <td bgcolor="#000066"><strong><span class="Estilo53">Comentario</span></strong></td>
                          </tr>
                        <tr>
                          <td bgcolor="#FFFFFF"><div align="justify" class="Estilo58"><?php echo $row_Recordset1['comentario']; ?></div></td>
                          </tr>
                        </table>
La cuestion es que donde deberia de extraer los datos del comentario de la base de datos <?php echo $row_Recordset1['comentario']; ?>, no me los acepta, siempre me pille uno de la db y me lo repite, no diferencia la id.

Os pongo el ejemplo

http://www.apuestatv.es/index3.php?dia=4&mes=9&ano=2008

Añadi en uno Prueba 1 y en el otro Prueba 2, pero sin embargo en ambos me marca como prueba 1


Alguien sabe como solucionarlo, gracias