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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.