This topic is locked

Check if specific record exists

7/6/2009 6:39:56 AM
PHPRunner General questions
M
mauro author

//** Check if specific record exists ****

global $conn;

$strSQLExists = "select * from ticket where datachiusura like '%200%'";

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

$data=db_fetch_array($rsExists);

if($data)

{

echo "<script>alert(\"vero\");window.location.href='ticket_list.php?a=return';</script>";

}

else

{

echo "<script>alert(\"falso\");window.location.href='ticket_list.php?a=return';</script>";
}
don't work ??????

J
Jane 7/6/2009

Hi,
could you clarify what doesn't work properly?

M
mauro author 7/6/2009

Hi,

could you clarify what doesn't work properly?


if datachiusura like '%200%'" or not , i have always the first script (<script>alert(\"vero\")....)

M
mauro author 7/7/2009



if datachiusura like '%200%'" or not , i have always the first script (<script>alert(\"vero\")....)


Thats' ok
global $conn;

$strSQLExists = "select * from ticket where status like '%SOME VALUE%' and id='$_REQUEST[editid1]'";

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

$data=db_fetch_array($rsExists);

if($data)

{

echo "<script>alert(\"SOME TEXT\");window.location.href='ticket_ict_view.php?editid1=$_REQUEST[editid1]';</script>";

}