February 1st, 2013, 08:46 AM
Error in script but cant see where?
Hi, I have an error somewhere in this script but i cant see where im going wrong.
Can anyone point me in the right direction.
its a script to allow the edit of some feilds.
$host = "localhost";
$user = "x";
$pass = "x";
$dbname = "x";
$connection = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."<BR>");
$PCN = $_GET['PCN'];
$results = mysql_query("select PCN, REG from selfticket where PCN = $PCN");
$row = mysql_fetch_row($results);
<a href="edit.php?PCN=<?php echo $row['PCN']; ?>">Edit</a>
February 1st, 2013, 08:52 AM
The first error is using the deprecated MySQL extensions. You should be using PDO.
The second error is you assuming anyone here is clairvoyant and knows what error message you are getting or what is not working.
There are 10 kinds of people in the world. Those that understand binary and those that don't.
February 1st, 2013, 10:58 AM
I was getting a blank output or "array"
the problem was located in mysql_fetch_row which should have been mysql_fetch_assoc