hi all! lame programmer here again.Please explain this thing..seems like it has truth table and stuf.anding oring etc..plz explain how this will execute.need simple explanation so i wont forget throughout my life..:D
The script is checking for errors, if there is no errors then it kills it self before it enters the first statement. If there is an error then it checks to see if the error number matches error 1062 (has to be exact notice the == ) if this passes then it chanegs the bool to true (1) on error_flag and echos out the error number then kills the script. If its not error 1062 it just changes the error flag to 1 and outputs nothing. Seems trvial to me and prob for a class. Study harder :-P
i wanted to know more about the execution of the first if statement where there is condition with || OR sign.i wanted to know true true false false stuff..if it is applicable in php and this ultimately in this first if statement. :)
The first statement is looking at a sql query mysql_query($sql,$con) and mysql_query($sql_pin,$conn). the first part the $sql or $sql_pin are both sql queries contained. The second part $con is the connection. Bascially what the if statement is testing is to see if the query works. If any errors at all are brought up as the php queries the server, such as incorrect syntax stored in that query variable. If any errors then the if statement holds as true!. If the query runs with no hitches then it held as false. if either or both of these queries fail then it doesnt run. Because your using the OR operator only one of the two queries have to fail, not both. If they both work then none of the code below in the brackets is executed.