I need some suggestions to prevent SQL injections. I've a mysqli query to fetch some names from database.  $con = mysqli_connect( "localhost","my_user","my_password","my_db" );  mysqli_query( $con, "SELECT names FROM my_table WHERE names LIKE '$names' AND DATE_FORMAT(DOB, '%d/%m/%Y') = '$date'" );   I want to prevent my query from SQL injection. I read some articles regarding SQL injections and saw that the following methods can be used to prevent SQL injection;   mysqli_real_escape_string Prepared Statements   But I am confused that which method is more secure. Or any other method is available which is more secure than above methods?  How can I implement this with my sample query?
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?
I never had this problem until today. When I watch a youtube video everything is fine, until I make the video fullscreen. It actually continues to play perfectly when fullscreen, but when I then exit fullscreen my sidebar and topbar are gone, and the screen is just frozen. Also my cursor is gone. It does seem to respond to ALT-F4, but it takes about 15 seconds to even close the window, and after that everything is unusable (basically frozen). What's strange though, when I re-enter fullscreen after exiting (and unity being frozen) the video plays perfectly still.   For now my workaround is opening tty1 and executing pkill -u username which logs off the user. I have looked at /var/log/syslog but it seems to be empty.  Is this freezing a common problem, if not, how can I make steps to fix this?    EDIT with specs:  I'm on a simple Samsung laptop with:  Ubuntu 14.10 64-bit,  Intel® Core™ i5-3210M,  Intel® Ivybridge Mobile (So integrated intel hd graphics 4000),  8GB ram. I don't think i've ever changed my video drivers, but it's reported as i915.  Ubuntu is up to date, and my browser is Chrome 40.0.2214.91 (64-bit). (Will test out now with firefox, but already posting this because my pc might freeze again)     EDIT 2: It doesn't freeze on Firefox. Will try reinstalling chrome now... EDIT 3: Reinstalling chrome didn't help. Will try chrome 32-bit too now... How can I backup my programs/applications, so that after I reinstall a new one, I can still use the backup-ed ones? Is there a way, that I could backup all my programs, all apps, put them in a directory or something, so that I could install them quickly next time, without having to manually going over the app center, downloading them from terminal, etc?  Note that I might import them from a distro other than the one I exported them on. So, say I'm in Ubuntu, exported some stuff, and then installed BT and wanted to import them from there. How do I use one shape to delete a portion of another shape? I have created an arrow shape (rightmost in image), from which I wish to cut out the majority so that only two thin sides remain. The most accurate way to do this would be to duplicate the shape and to somehow use the duplicate (leftmost in image) to remove the chunk that I no longer desire from the original. I am not sure what to do after the duplication, however, or if this method is even possible? Is there a better one? Proving which QM interpretation is correct Let's assume that the existence of gravitons is theoretically proven or they are detected by LHC could one interpretaion be proven correct? How to add a class to a given element? Describe the equivalence classes in terms of familiar mathematical objects Why are floating point numbers inaccurate? Is there a difference in ++i and i++ in a for loop? Is it simply a syntax thing? The particle number on my settings appear in gray, I don't think i'm able to change the number even thought i need it, how can i make it white again? Suppose $a_0,a_1,a_2$ satisfy the recurrence $a_n = 3a_{n-1}-3a_{n-2}+a_{n-3}$ for $n\ge3$   Let $c_n=a_{n+1}-a_n$ for $n\ge1$ and $c_0=0$   Find a linear recurrence of degree at most 2 for the sequence $c_0,c_1,c_2,...$  I'm not entirely sure what they are asking for but I think it is asking for a recurrence relation for $c_n$ where the characteristic polynomial has degree at most 2.  I tried finding a closed form for $a_n$ to try and get rid of the $a_n$ in the $c_n$ equation, but I can't figure it out when the initial conditions aren't specified ($a_0,a_1,a_2$)  Any help would be appreciated! Let's say we have a Python script my_script.py that does some data processing with Blender. This script accepts some arguments (e.g. arg1 arg2). How can I forward arguments to the script when using it with the CLI?  blender --background --python my_script.py   The only trick I could find was :  echo "arg1 arg2" &gt; my_input.txt &amp;&amp; blender --background --python my_script.py   Is this really the only way to do that?  Update  I found a  on Stack Overflow. How can I emulate 1.7.10's adventure mode in 1.8? In an Integral Domain is it true that $\gcd(ac,ab) = a\gcd(c,b)$? Encrypting a folder I'm familiar with bitlocker, having been using it for a while, but I am looking at just encrypting a folder instead. But I just don't understand the options it's giving me.  When I right-click a folder > properties > advanced > [x] encrypt contents to secure data > OK &lt; apply > ...  I get:  () apply changes to this folder () apply changes to this folder, sub-folder and files.   This doesn't make sense to me at all, if I encrypt a folder then the whole folder, everything within it is encrypted, then why should I be given these options, how can I have a folder encrypted and files within that folder unencrypted, that seems stupid to me, it doesn't make sense at all.  Can anybody explain why these options exist and how can I simply encrypt a folder? I tried to open Software Center using the command line   software-center   and it did work. I mean, Software Center opened and works fine, BUT, at the same time, in the Terminal window I see a lot of strange errors. How can that be? I'm puzzled.   Is there any explanation for this (and a fix for it)? I repeat, the app does open and it works fine, is only the lines in the background that show that something is not all right.  Here are the screen-shots with all the lines. Where are the review queue counters? The review queue counters have disappeared:        Where are they?  When I did screenshot the Close Votes queue was not empty, if someone think so. My distribution is normal; Kolmogorov-Smirnov test doesn't agree I have a problem with the normality of some data I have:  I've done a Kolmogorov test which says it isn't normal with p=.0000,  I don't understand: the skewness of my distribution =-.497, and the kurtosis =-0,024  Here is the plot of my distribution which looks very much normal ...  (I have three scores, and each one of this scores isn't normal with a significant p-value for the Kolmogorov test ... I really don't understand ) Alien invasion movie, giant robot aliens with long legs capturing people Cancellation of Direct Products How do I effectively defeat the Wall of Flesh? I've been having trouble defeating this monster. Even with lots of buff potions, health potions, high tier armor (Molten), and ranged weapons with plenty of ammo (Minishark), I can't seem to kill this boss.  Worse, when I get it down to about 2000 hp, even if I'm fairly far away, it'll suck me in and continually rise towards the skybox, which doesn't allow me to do anything for some reason.  How do I defeat the Wall of Flesh? What gear should I be using and what kind of potions do I need?