From what i have seen the script works so what are you arguing about :S

From what i have seen the script works so what are you arguing about :S
I have worked with PHP probably years more then you have.Well, it's a waste of server resources, time, and most importantly, waste the energy your fingers have to go to typing it in
That's all you need to do to check for rows returnedPHP Code:if(mysql_num_rows($query) > 0) {
// Rows were returned
}
else {
// No rows returned (0)
}
I think I know how to code.
Plus why add the num_rows into the if statement, thats a waste of typing plus server resources if you are expecting to use the num rows again
So please don't tell me how to code, when I know how to![]()
Oh yeah XD i get confused easy![]()
I'm not saying you don't know how to code, I'm just letting you know that it's a waste of time checking for empty strings, when mysql_num_rows will never return an empty string.I have worked with PHP probably years more then you have.
I think I know how to code.
Plus why add the num_rows into the if statement, thats a waste of typing plus server resources if you are expecting to use the num rows again
So please don't tell me how to code, when I know how to
The code was used as an example. Of course, if you were expecting to use the data again, you would store it in a variable. However, even if I was modelling the code off Waterfall's question, from the looks of things, he wouldn't need to use it again (why would he need to check for multiple IP entries in a script twice)? I suggest you stop the "I've been coding for years more than you" ploy. The length of time someone has been practising at something is a bad portrayal of skill, as seen here.
No actually it isn't.
If you have no DB connection, and you do mysql_num_rows and error reporting is off, you would receive an empty string
Also if you do num_rows without an actual query, and without any error reporting it returns an empty string.
That is true.. because it dose not exist
I think thats the reason I started doing it that way to begin with.
... That's one of the most ridiculous arguments I've heard. If there wasn't a database connection in the first place, you'd have a lot more to worry about than what mysql_num_rows was returning. In addition, the entire script would be rendered useless, because it would be unable to perform queries needed to function properly.
I would bet a large sum of money that software developers like Jelsoft, Invision and the like don't test for empty strings, when validating mysql_num_rows results, for the reason that it is so petty. If they don't, then there surely is no point.
Look, it doesn't matter.. I use it, you don't.. it doesn't change a thing. I will still use it, you don't have to.![]()
Want to hide these adverts? Register an account for free!