Hi Shallimus
I took your advice, but changed the select statement a bit. However, with the $identical checks, i seem to go into the if-part of my statement, which displays an error message. I understand why, because identical=1.
What i would like to know, is if I am putting the $identical check in the right place???
Here's the code causing me endless problems:
else if ( $SelectID == "New ID Entry" )
{
$identical = 0;
if ( $SelectBehaviour == "Todays Focus" )
{
$check_record = "select behaviour,
active_date, active_time, headline,
image_path";
$check_record .= "from focus_line ";
$check_record .= "where behaviour
= '$SelectBehaviour' ";
$check_record .= "and active_date
= '$years-$months-$days' ";
$check_record .= "and active_time
= '$hours-$minutes' ";
$check_record .= "and headline
= '$headline' ";
$check_record .= "and image_path
= '$image_path' ";
$identical = 1;
}
else if ( $SelectBehaviour == "Focus
Line" )
{
$check_record = "select behaviour,
headline, focus_url ";
$check_record .= "from focus_line ";
$check_record .= "where behaviour
= '$SelectBehaviour' ";
$check_record .= "and headline
= '$headline' ";
$check_record .= "and focus_url
= '$url' ";
$identical = 1;
}
$result = dbi_query( $check_record );
if ( $identical == 1 )
{
echo "<h4 align=\"center\"> This
record already exists!!! </h4>";
}
else if ( $identical == 0 )
{
if ( $SelectBehaviour == "Todays
Focus" )
{
$ins_sql = "insert into ...blah, blah
}
else if ( $SelectBehaviour == "Focus
Line" )
{
$ins_sql = "insert ... blah, blah
}
dbi_query( $ins_sql );
}
Do u see where I am going wrong???
Tasneem