![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| mysql query all entries which 'dont' match | hazno | UNIX and Linux Applications | 1 | 04-08-2009 12:47 AM |
| MySQL Query Analyzer: Interview with Mark Matthews | iBot | MySQL DevZone RSS | 0 | 11-10-2008 10:50 PM |
| How to query one to many mysql | pinkgladiator | High Level Programming | 0 | 10-30-2008 01:45 PM |
| mysql query browser issue | venhart | UNIX and Linux Applications | 3 | 09-18-2008 08:05 AM |
| set mysql password with host parameter | ankimo | UNIX and Linux Applications | 1 | 09-16-2008 02:50 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
? parameter in mysql query
I am debugging some code and came across ? in the WHERE cause in a mysql query.
Is this possible and what situations would this be used? Code:
SELECT ip, count FROM table WHERE domain=? |
|
||||
|
? is a parameter placeholder. That way you don't have to directly compose the SQL with parameters given (failure to escape the parameters properly is the major reason for SQL injection attacks).
Typically, the ? is not valid at the database layer. Normally the database library will dynamically replace them with the parameters (converting where necessary) in the SQL and pass the resulting the query to the database. In other cases, the database engine may accept placeholders itself, especially true if the db supports prepared statements so that an SQL can be prepared once, thus allowing it to be instantiated multiple times to perform the same query with different set of parameters. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|