Ver Mensaje Individual
  #3 (permalink)  
Antiguo 17/02/2013, 13:06
Z3R0_C00L
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: sacar id automaticamente

muro.php

<?php
error_reporting(0);
include('src/db.php');
include('src/funtions.php');
include('src/link.php');
include('src/uid.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Connect2</title>
<link href="muro/css/style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="muro/js/wall.js"></script>
</head>
<body>
<div style=" margin-top:50px; margin-left:50px" class="container">

<div id="updatebox">
<textarea id="update"></textarea><input type="submit" id="updatebtn" value="Publicar" />
<div id='flash'></div>
</div>

<div id="update_post">
<?php include('updates.php'); ?>
</div>

</div>

</body>
</html>

update_delete.php

<?php
error_reporting(0);
include('src/db.php');

$query_delete = "DELETE FROM publicaciones WHERE id_public = '".$_POST['id']."'";
$query_sql = mysql_query($query_delete, $connection);
?>

updates_new.php

<?php
error_reporting(0);
include('src/db.php');
include('src/uid.php');
include('src/link.php');
$times = time();
$update = tolink(htmlentities($_POST['update']));
$query_poster = mysql_query("INSERT INTO publicaciones (user, msj, time) VALUES('".$uid."', '".$update."', '".$times."' )", $connection) or die(mysql_error());

//Updates SQL
$query_post = mysql_query("SELECT * FROM publicaciones WHERE user = '".$uid."' and time = '".$times."' order by id_public desc") or die(mysql_error());
$row_post = mysql_fetch_array($query_post);
$nums_post = mysql_num_rows($query_post);

$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'];?>&nbsp;<?php echo $row_post_user['apellidoMaterno'];?></b><br />
<?php echo $row_post['msj'];?><br />
<!--Options -->
</div>
</div>