User input will be another language with English. So I want to sanitize data before putting it on mysql database.  So here is my code:  mysqli_set_charset($conn,"utf8"); function sanitize_data($data) {     global $conn;     $output = '';     if(isset($data)) {         $output = mysqli_real_escape_string($conn, $data);     }     return $output; }   Is there any way to make it more sanitized? Website will be public forum/blog type. Anyone can write if they are registered.
If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?
$f$ strictly increasing does not imply $f'>0$ We know that a function $f: [a,b] \to \mathbb{R}$ continuous on $[a,b]$ and differentiable on $(a,b)$, and if $f'&gt;0 \mbox{ on} (a,b)$ , f is strictly increasing on $[a,b]$. Is there any counterexample that shows the converse fails?   I have been trying to come up with simple examples but they all involve functions that are discontinuous or has derivative $f'=0$ which does not agree with the hypothesis hmmm How can I remap Caps lock to both Escape and Control? I tried running the following statement:  INSERT INTO VOUCHER (VOUCHER_NUMBER, BOOK_ID, DENOMINATION) SELECT (a.number, b.ID, b.DENOMINATION)  FROM temp_cheques a, BOOK b WHERE a.number BETWEEN b.START_NUMBER AND b.START_NUMBER+b.UNITS-1;   which, as I understand it, should insert into VOUCHER each record from temp_cheques with the ID and DENOMINATION fields corresponding to entries in the BOOK table (temp_cheques comes from a database backup, which I'm trying to recreate in a different format). However, when I run it, I get an error:  Error: Operand should contain 1 column(s) SQLState:  21000 ErrorCode: 1241   I'm running this in SQuirrel and have not had issues with any other queries. Is there something wrong with the syntax of my query?  EDIT:  The structure of BOOK is:  ID  int(11) START_NUMBER    int(11) UNITS   int(11) DENOMINATION    double(5,2)   The structure of temp_cheques is:  ID  int(11) number  varchar(20) What are the differences between "to talk" and "to speak"? Both verbs "to talk" and "to speak" refer to the same action.  Is their meaning exactly the same? When is more appropriate to use one, or the other verb? How to make /sbin/shutdown, /sbin/reboot etc. require sudo again in 16.04? For whatever reason, we do no longer need to be root (or using sudo) to run /sbin/shutdown, /sbin/reboot etc.  This seems to be because those executables are now symlinks to /bin/systemctl which handles everything as normal user.  However, what if I want shutdown and reboot to require root authentication again? How can I achieve this? Cannot mount USB stick - errors out with "$MFTMirr does not match $MFT" How does the British-Irish Visa Scheme (BIVS) work? I am an Indian citizen and have applied for the Standard Visitor visa to the UK, and wish to travel to Ireland by using the BIVS scheme.    Do I need to fill up a separate application for BIVS endorsement or is it handed out automatically?  Also, If I enter the UK, and then travel to Ireland, can I re-enter the UK again? Inequality of $\vert \text{tanh}(x)-x+\frac{x^3}{3}\vert\leq\frac{1}{8}$ for $x\in[-1/4,1/4]$ I have an assignment, that I cannot seem to find a starting point for. I am not looking for the specific answer, but only where to begin. Any pointers are appreciated.  I have to prove the inequality $\vert \tanh(x)-x+\frac{x^3}{3}\vert\leq\frac{1}{8}$ for $x\in[-1/4,1/4]$ where $x-\frac{x^3}{3}$ is the 3rd order Taylor expansion.  I've tried with the triangle inequalities, Lagrange remainders, and a lot of other stuff, but I am no where near a correct argumentation. Does anyone have any suggestions? The meaning of imaginary time What is imaginary (or complex) time? I was reading about Hawking's wave function of the universe and this topic came up. If imaginary mass and similar imaginary quantities do not make sense in physics, why should imaginary (or complex) time make sense?    By imaginary I mean a multiple of $i$, and by complex I mean having a real and an imaginary part, i.e., $\alpha + i\beta$, where $\alpha, \beta \in {\mathbb R}$. Does Google use the Meta Description Tag for Description of Page? When you do a Google search, there is typically a snippet of sample content from the page. I seem to recall that the Meta Tags can influence this choice of descriptive sentences. Is that correct(?) and if so, is it the Meta Description Tag?  Also, how many characters is Google's descriptive sentences limited to? How do Natures work? In at least some Pokemon games there are modifiers called "Natures" which affect pokemon stats. What do they do and how do it work? Also, what specific games possess it? I found this in . I've paraphrased for clarity.  There are 100 professors. Some are honest, while others are dishonest. There are more honest professors than dishonest ones. Honest professors always tell the truth, but the dishonest ones sometimes tell the truth and sometimes lie. You can ask any professor the following question about any other professor, "Professor Y, is Professor X honest?" to which he/she will answer yes or no. Design an algorithm that allows you to figure out which of the professors are honest with no more than 198 questions.  The bold part is the kicker. If liars always lied, then the problem is trivial - just ask 99 people about one guy. The majority would be the truthful answer, so you know your honest guys and your liars.  So, any advice? If you give the answer please put it in spoiler tags since I'm just looking for direction. How do I give text or an image a transparent background using CSS? Solve $\lim_{x\to 0} \frac{\sin x-x}{x^3}$ Is there a word for someone who has others do all their work for them? In a way like a slave master. More though like say someone who had robots do all their work and they were never themselves productive and had no drive. If you've read R.U.R. you'll understand the question better. I'm looking for a word with more definition than just lazy.  Update 1: It think I may actually go with drone if anything. I think that definition fits what I'm looking for the best. I also liked the definition of the British term layabout that one person mentioned, but I will probably use drone. Thanks for all the help and sorry if I was confusing or unclear.  Update 2: I needed this word for use in an essay I was writing which I have now handed in. Thanks for the help guys. No more suggestions needed. One-sided limits of $f'(x)$ at a point vs. one-sided limits of the difference quotient at that point I know that if a function is piecewise, then when differentiating it one needs to deal separately with the points of intersection of the pieces, because the derivative may not be defined there.  Also, if a one-sided limit of $f'(x)$ at these "crucial points" is infinite or doesn't exist, it doesn't preclude the limit of the difference quotient from existing and being finite. For example, take $f(x)=x^2\sin\frac1x, f(0)=0$: $f'(x)= 2x\sin\frac1x-\sin\frac1x $ has no limit as $x\to0$ but $\lim\limits_{h\to0}\frac{f(h)-f(0)}{h}=0=f'(0)$.  On the contrary, looking at $f(x)=\sin x +\lvert \sin x\rvert $ on $[0,2\pi]$ one has $f'(x)=2\cos x$ on $(0,\pi) $ and $f'(x)=0$ on $(\pi,2\pi)$ so $\lim\limits_{h\to0^+}f'(\pi+h)\ne\lim\limits_{h\to0^-}f'(\pi+h)$, but they are both finite. And in this case it's easy to find that they agree with the one-sided limits of the difference quotient. Why? Does the finiteness of the former imply that they agree with the latter? Is this also true if the one-sided limits of $f'$ at the crucial points agree with each other? 529 plan withdrawal penalties My son is a freshman this year.  We live in and he attends school in California.  We pulled out the first $ from our Utah 529 plan.  I had the money deposited in my account since I paid the registration and dorm &amp; meal plan.  Our friend has a son a year ahead and he has the exact same 529 plan.  He warned me that he got hit with a small tax penalty when he withdrew the money to his account and not to an account in his son's name.  I called the 529 administrator and they said it shouldn't matter either way.  Other online blogs agree.  They say the only difference is that my son would get the tax forms and have to file if it went to his account. Nevertheless, my friend did get a penalty.  Any clarity would be appreciated! I'm trying to figure out how to send all information that is normally identified in the /var/adm/message file on a Solaris system to a remote system. Convergence in probability implies convergence on a subsequence almost surely.  But this means we fix a subsequence, such that $X_{n_k}$ converges for almost every $\omega$, right? The subsequence we pick does not depend on the $\omega$ right? Consider the infinite line, $L$ in $2D$ consisting of all points $p$ such that $p.[0.3511 0.9263]= 6$. Find the point on the line closest to $(10, 20)$. Find the point on the line closest to $(4, 3)$. Find the distance from the line to both of these points.  Hi, I was reading the book $3D$ Maths Primer for Graphics and Game Development. The book mention about $2$ formulas but I don't know how to apply them.   $\text{Signed distance} = d-q.n$  $q' = q + (d-q.n)n$  for any point $q$, the point $q'$ that is the closest point on $L$ to $q$.  This is what I have tried,   Since the lines are parallel then the normal are the same so   $q' = q + (6 - q(0.3511 0.9263))(0.3511 0.9263)$   I'm stuck here.