This topic is locked

Before edit: check for value in table.field

7/9/2007 6:46:26 PM
PHPRunner General questions
C
chaz author

HI,
phprunner has a check for if a table exists but what if i need to check for value in a field is less than or greater than??
ie. can edit field X, if the value in field Y is less/greater than Z

C
chaz author 7/10/2007
if( $values["FIELD_TO_BE_EDITED"] < '10' )

{ return true; }
RETURN FALSE;


WHY WONT THIS LET ME EDIT?

C
chaz author 7/11/2007
global $conn;

$strSQLExists = "select * from characters where level<'10'";

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

$data=db_fetch_array($rsExists);

if($data)

{

// if record exists do something

if ( $data["guid"] == $values["guid"] )

{ return true; }

}


Hey there what am i missing here???
am editing table character when field level is less than 10, but only when the guid is same as guid in another table

C
chaz author 7/11/2007

hello
<<< Record updated >>>
but it does NOT update at all !!! it just crashes another program using the same DB