Nafisah Posted May 15, 2013 Share Posted May 15, 2013 Notice: Undefined index: id in C:\xampp\htdocs\Guttz\Edit.php on line 2 <?php $id = $_GET['id']; $host = "localhost"; $user = "root"; $pass = ""; $db = "guttz"; $link = mysqli_connect($host, $user, $pass, $db); $query ="SELECT * FROM designers WHERE id ='$id'"; $result = mysqli_query($link, $query); $row = mysqli_fetch_array($result) or die (mysqli_error($link)); mysqli_close($link); ?> The get and the post has been the problem . How can I store and save id in session. What is the codes for it ? Quote Link to comment Share on other sites More sharing options...
CrossMotion Posted May 15, 2013 Share Posted May 15, 2013 It seems you dont send the GET var ID when you load the page. Try loading the page with ?id=1 at the end. If you want to save the id in a session, you need to open the session at each page before you do anything else by adding session_start(); at the top of the page; After that you can just get and set session vars like regulair vars. ( $_SESSION['id'] = $id; and $id = $_SESSION['id']; ) Good Luck Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.