Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 1161
1 vote
Accepted

How do I use SQL transactions?

[, ... ] */) { // SQL statement $sql = func_get_arg(0); // parameters, if any $parameters = array_slice(func_get_args(), 1); // try to connect to database static $handle; … ; } // execute SQL statement $results = $statement->execute($parameters); // return result set's rows, if any if ($results ! …
kzidane's user avatar
  • 17.7k
0 votes
Accepted

LIKE vs equal sign - basic question

as far as I know, they would return the same result in this case, but the second query may execute faster because it compares the values directly while the first would supposedly do pattern-matching ( …
kzidane's user avatar
  • 17.7k
4 votes
Accepted

Problem Set 7 (fighting of SQL injection attack)

If you look at the code for query (I replaced the irrelevant parts with comments for the sake of shortness) function query(/* $sql [, ... ] */) { // SQL statement $sql = func_get_arg(0); … SQL statement. …
kzidane's user avatar
  • 17.7k
2 votes
Accepted

How is Week 9 SQL Atomocity solved?

I think the professor was referring to the process of updating when he analogized this to a SELECT query and an INSERT query at the same time, because that's probably how you'd probably do an update m …
kzidane's user avatar
  • 17.7k
3 votes
Accepted

What does VALUES(shares) refer to in the ON DUPLICATE KEY UPDATE clause?

According to the docs: You can use the VALUES(col_name) function in the UPDATE clause to refer to column values from the INSERT portion of the INSERT ... ON DUPLICATE KEY UPDATE statement. In ot …
kzidane's user avatar
  • 17.7k
1 vote

Printing from SQL in PHP

recall that, assuming the query is syntactically correct, query returns an array of the resulting rows (if any) or an empty array otherwise. try print_r'ing $comment to learn about the structure of th …
kzidane's user avatar
  • 17.7k