17/02/2013, 13:07
|
|
Respuesta: sacar id automaticamente updates.php
<?php
//Updates SQL
$query_post = mysql_query("SELECT * FROM publicaciones WHERE user = '".$uid."' order by id_public desc") or die(mysql_error());
$row_post = mysql_fetch_array($query_post);
$nums_post = mysql_num_rows($query_post);
if($nums_post <= 0){
echo "<center><h2>No hay publicaciones</h2></center>";
}else{
do{
$query_post_user = mysql_query("SELECT * FROM usuarios WHERE id_usuario = '".$row_post['user']."'") or die(mysql_error());
$row_post_user = mysql_fetch_array($query_post_user);
?>
<div class="postbody" id="postbody<?php echo $row_post['id_public'];?>">
<!--Imagen -->
<div class="postimg">
<img src="<?php echo $row_post_user['avatar'];?>" class='big_face'/>
</div>
<!--Imagen -->
<div class="posttext">
<!--close -->
<a class="postdelete" href="#" id="<?php echo $row_post['id_public'];?>">
<img src="muro/img/trash.png" width="16" height="16" class="hover_alfa" />
</a>
<!--Close -->
<b><?php echo $row_post_user['apellidoPaterno'];?> <?php echo $row_post_user['apellidoMaterno'];?></b><br />
<?php echo $row_post['msj'];?><br />
<!--Options -->
</div>
</div>
<?php
}while($row_post = mysql_fetch_array($query_post))
?><?php
}
?>
uid.php
<?php
$uid = '1'; // user
?> |