Hi all,
Can anyone advise me if this is correct code or verbose code.
//first use of the sql variable
$sql_statement = "Select .......from.....";
//do something like fetch rows
//Here is the re setting to null to re use the sql variable
$sql_statement = null;
$sql_statement = "Select .......from.....";
//do something again like fetch rows
I reset the sql variable to null to ensure the sql string is exactly
the new typed in sql string, a friend of mine thinks this is verbose
coding as the sql variable is written over which I believe is correct
but my counter statement is that mine is more secure (I am using the sql variable multiple times on the same page) and by setting the sql variable to null or empty I know exactly the sql string that will be parsed i.e. no other string will be appended.
who is correct? and is there any other way to do this?
thanks
BBK 🙂