This is the code which im having problems with (its not all the code, so i am not missing the <?php, or a }) $sql_query = "SELECT * FROM links WHERE id='$id'"; //store the SQL query in the result variable $result = mysql_query($sql_query); if(mysql_num_rows($result)) { //output as long as there are still available fields while($row = mysql_fetch_array($result)) { $title = $row["title"]; $url = $row["url"]; $id = $row["id"]; $status = $row["status"]; $email = $row["email"]; } Code (markup): Im trying to get it to let you edit the information in the 'links' part of the database. The page before has this code: <a href=\"editlink.php?id=$id\">Edit</a> Code (markup): The id is right and everything, but the page always shows it as blank. I had it working a long time ago, then kind of forgot about it and now it doesnt work.
<a href=\"editlink.php?id=$id\">Edit</a> Code (markup): Are you using an "echo" to output that part or is that pure html code? If it's html, then you need <a href=\"editlink.php?id=<?php echo $id ?>\">Edit</a> Code (markup):
Try changing this: while($row = mysql_fetch_array($result)) PHP: with this: while($row = mysql_fetch_assoc($result)) PHP: HTH, cheers!
Trace if $id has some value in it. print "ID IS " . $id; $sql_query = "SELECT * FROM links WHERE id='$id'"; .............. PHP: If id is empty, then try following code $id = $_GET['id']; $sql_query = "SELECT * FROM links WHERE id='$id'"; .............. PHP:
Probably this is not why your script isn't working, but why do you put this if statement: if(mysql_num_rows($result)) { ... } PHP: Maybe it'ld be better to use (because ID is unique, it'll always return the same) if(mysql_num_rows($result) > 0) { ... } PHP: The fact your page is blank, possibly you could try to get all PHP warnings and errors by putting the following code just after <?php at the beginning of the page: error_reporting(E_ALL); PHP: I keep watching this