07.07.2013, 20:10
Few tips for you my friend.
1) Selecting everything can be done without count too, just '*'.
2) Like Jefff showed you, your way to retrieve the next ID is incorrect.
3) printf is used to insert parameters and format the text which is going to be printed. No need to use format before.
4) Whever you use "SELECT" statement is SQL, free the result. Trust me, you don't want to see what will happen!
5) You can use '' to strings; however, it's not necessary to do that on integers and floats. If you have 20 variables (integers) to insert * 2 characters (''), it's waste of the Query.
6) Make sure the string is big enough to be executed, else it will not.
1) Selecting everything can be done without count too, just '*'.
2) Like Jefff showed you, your way to retrieve the next ID is incorrect.
3) printf is used to insert parameters and format the text which is going to be printed. No need to use format before.
4) Whever you use "SELECT" statement is SQL, free the result. Trust me, you don't want to see what will happen!
5) You can use '' to strings; however, it's not necessary to do that on integers and floats. If you have 20 variables (integers) to insert * 2 characters (''), it's waste of the Query.
6) Make sure the string is big enough to be executed, else it will not.