need ur help regarding the above matter.
Please state the matter in the post. Don't use the title as part of your question. It's only meant to give us an idea about what we're about to read.
I've write a code for if statement but it didnt work as expected when I run the program.
I assume you mean the IF statments like:
if (sprintf(query2,
"select * from Register where MasterAccNo = 'NONE'")
== 0)[b];[/b]
What the sprintf() statement does is load the first parameter (query2) with the rest of the parameters and returns the number of characters loaded. Therefore, each and every IF will fail.
But notice the character at the end of the IF (in red), that will end the IF. Therefore the code block is executed because it's not part of the IF at all.