Jump to content

What does ? mean in an sql query?


horseatingweeds

Recommended Posts

Yeah right wildteen88. You know, when you're dealing with technical information on a forum like this you have to remember you're not talking to yourself, you're talking to people that don't understand something. Fenway gave me a clue. Your article didn't have anything about a ?. And I still don't know what <- is all about. No answers.

 

So, from reading in a book I have, after the prepared statements clue, I guess ? is a place holder for something else. "It's a place holder for something." would have been an answer.

 

I'm still confused a bit. But in the code I'm looking at, the line after my example above is:

 

$query = $this->_db->quoteInto($query, $url . '%');

 

So I guess the ? is a placeholder for the $url variable.

Link to comment
Share on other sites

<- is an arrow.

 

Your article didn't have anything about a ?.

 

Actually, I guess you didn't actually read the article -- don't blame wildteen88.

 

What are server-side prepared statements?

 

Prepared statements are the ability to set up a statement once, and then execute it many times with different parameters. They are designed to replace building ad hoc query strings, and do so in a more secure and efficient manner. A typical prepared statement would look something like:

 

SELECT * FROM Country WHERE code = ?

 

The ? is what is a called a placeholder. When you execute the above query, you would need to supply the value for it, which would replace the ? in the query above.

 

Anyway, since we can't guess what quoteInto does, it's hard to say... but since there are only two parameters, it appears that the placeholder will be substituted with "$url . %"

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.