PHP mysql edit database entries -


so have 2 php file first one

  <?php   include"db.inc.php";//database connection   $order = "select * notes";   $result = mysql_query($order);   while ($row=mysql_fetch_array($result)){     echo ("<tr><td>$row[name]</td>");     echo ("<td>$row[comment]</td>");     echo ("<td>$row[timestamp]</td>");     echo ("<td><a href=\"edit_form.php?id=$row[timestamp]\">edit</a></td></tr>");   }   ?> 

and second one.

  <?php   include "db.inc.php";//database connection    $order = "select * note     timestamp='id'";   $result = mysql_query($order);   $row = mysql_fetch_array($result);   ?> 

the , id=$row[timestamp] in first file , where timestamp='id'"; how value of id in second file equal id in first file. thanks

use $_get here

include "db.inc.php";//database connection  $id = $_get['id']; $order = "select * note timestamp='$id'"; 

start using pdo or mysqli prepared statement, code full sql injection.

edit

in third file access variable using $_post

$id = $_post['id'];  $name = $_post['name']; 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -