Jump to content

[SOLVED] mysql_query or "..."


nathanmaxsonadil

Recommended Posts

I would say mostly for error handling. If you store the query as a string you can easily echo it out and see if theres a problem.

 

Also, it makes it easy to add to the query. If you just put it into the mysql_query(), you can't really do anything with it, it's stuck the way it is.

 

There may be other reasons that other people do it for, but those ones seem the most obvious to me.

Link to comment
https://forums.phpfreaks.com/topic/66786-solved-mysql_query-or/#findComment-334646
Share on other sites

Because they think it's easier / more readable to have the actual mysql query standing by it self instead of inside the mysql_query() function?

 

I personally do:

 

$get_or_insert_something = mysql_query("some query")

 

At least when I'm not using a framework or just creating some small script.

Link to comment
https://forums.phpfreaks.com/topic/66786-solved-mysql_query-or/#findComment-334648
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.