This topic is locked

Duplicate entry - Auto Link

8/1/2007 7:27:23 AM
PHPRunner General questions
F
funkfish author

Hello,
First off let me just say that PHPRunner is one of the greatest pieces of software that I have ever used. I have been using it for almost a year now and it has revolutionized my workplace. Props out to the entire Xlinesoft team!!!
I am working on a rather large project and am close to finishing it off but am looking for the last piece of the puzzle.

I have a duplicate query happening in my code and what I want is to show the "Duplicate found" with a link to go to the edit screen of that duplicate entry.
Example, operator enters an order number - they get a display showing "Duplicate" and a link to the edit screen of that order number. Here is my code and many many thanks in advance!!!
function BeforeAdd(&$values)

{

global $conn;

$values["ordernumber"] = strtoupper($values["ordernumber"]);

$strSQLExists = "select * from allissues where ordernumber='".$values["ordernumber"]."'";

$rsExists = db_query($strSQLExists,$conn);

$data=db_fetch_array($rsExists);

$o=$values["ordernumber"];

$order=$values["id"];

if($data)

{
echo "<h2 style=color=red><a href='allissues_edit.php?$order'><font color=red size=6>Order ".$o." already exists!!<font color=black></a></h2>";
return false;

}

Sergey Kornilov admin 8/2/2007

This code looks good to me.
What exactly is the question?

F
funkfish author 8/3/2007

This code looks good to me.

What exactly is the question?


Hi Sergey,
The question is that I want the link to be "allissues_edit.php?editid1=199"

where 199 is queried against the duplicate order number.....
echo "<h2 style=color=red><a href='allissues_edit.php?$order'><font color=red size=6>Order ".$o." already exists!!<font color=black></a></h2>";
Thanks

Sergey Kornilov admin 8/3/2007

In my understanding your code does exactly what you need.
What happens when you run this code?