I want to protect database from SQL Injection. How can I use PDO or mysqli mysql_real_escape_string in this code. MY PHP Version is 5.6.36    public function LoginUser($email, $password)   {      /*      * echo $password= addslashes("$password"); die;      */     $sql = "SELECT ref,firstname,contact,email,parent_id FROM `pro` where passe=password('$password') and email='$email' "; // or login='$email'     $result = mysql_query($sql);     return $data = mysql_fetch_assoc($result);   }
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?
Some Git commands take commit ranges and one valid syntax is to separate two commit names with two dots .., and another syntax uses three dots ....  What are the differences between the two? How do you copy the contents of an array to a std::vector in C++ without looping? Calculating roundness/compactness of polygon? I am trying to find ways to quantitatively describe the shapes of various polygons. For my project, these polygons represent lakes, rivers, lagoons, and parks. So they can be almost any shape. One easy metric is to calculate perimeter vs. area, which is at best an only slightly useful metric. But I would also very much like to be able to say something about the 'roundness' of a polygon. Or how 'compact' the shape is on a map.  The only way I can think of doing this easily is to calculate the area of each polygon in relation to a bounding box for that polygon (which I already have). But this seems like a poor solution.  So now I am thinking of something more like this - take the centroid of the polygon, add on a series of buffers of increasing areas (say 50%, 100%, 150%), then compare how much overlap there is between each buffer and the original polygon. A perfect circle will have perfect overlap at 100%, and I can use the 50% and 150% buffers to judge how much and in what way each polygon differs.  But even that feels cumbersome, and like a poor workaround for what somebody else has probably already figured out far better.  For reference, at a minimum I will need to be able to look at the resulting indices for the shape of various polygons, and be able to make an educated guess as to their source (River? Reservoir with dendritic shape? Lake/Lagoon? Park?) Extra space between lines (gb4e) I am using gb4e.sty to provide inter-linear language glossing. This works well, but I want to get wider spacing between lines when sentences have 2 or more lines like this;   Here is my source code:  \documentclass{article} \usepackage{times} \usepackage{gb4e} \noautomath \let\eachwordone\it \setlength{\glossglue}{10pt plus 2pt minus 1pt}  \begin{document} \begin{exe} \ex \gll mukasi monosugoka jii atama=no an wanrjoku=no an samurai=ga utan=bee=cjo\\ old.days very good head=NOM exist strength=NOM exist samurai=NOM existed=HSY=ASS\\ \trans `Once upon a time, there was a samurai with a smart brain and strength.' \end{exe} \end{document}   Does anyone have a solution to this problem? Simple as the title states: Can you use only Java commands to take a screenshot and save it?  Or, do I need to use an OS specific program to take the screenshot and then grab it off the clipboard? says that a photon of  to $10^{-62}$ kg has been detected:     10×10−62 kg   Mass equivalent of the energy of the lightest photon   detected [citation needed]   This equates ($mc^2=E=hf=h\frac{c}{\lambda}$) to a wavelength of $\lambda=2.2\times 10^{20}$ m (roughly a million ly)! Can anyone provide a citation for this measurement? And how can such a large wavelength/low energy photon be detected?  Edit  Apart from the quotation (true/false un/reliable un/documented ....), I'd like to learn about the lightest photon detected, or about the instrumental limit: what is the lower limit of energy that can be registerd by an intrument (or the greatest wavelength), and how it is done? For example, can you detect a radiowave of 1 Hz? Is there an easy way to attach source in Eclipse? I'm a big fan of the way Visual Studio will give you the comment documentation / parameter names when completing code that you have written and ALSO code that you are referencing (various libraries/assemblies).  Is there an easy way to get inline javadoc/parameter names in Eclipse when doing code complete or hovering over methods? Via plugin? Via some setting? It's extremely annoying to use a lot of libraries (as happens often in Java) and then have to go to the website or local javadoc location to lookup information when you have it in the source jars right there! I played 1st and 2nd edition AD&amp;D a lot back in the day. But when 3rd edition came out, I dropped out of the hobby. Partly I just couldn't be bothered to re-learn the rules. The conversion systems, previews and material for 3rd edition I was seeing in Dragon and Dungeon magazines made it look like a very major change.  I recently picked up the new 5th edition starter set on a whim. Obviously the starter set rules are very stripped down in comparison to the full rules, but nevertheless, I was amazed by how comfortable and familiar the system felt. The only thing that felt like a truly radical change was the way things like thief skills and the like were now handled with a d20 instead of a percentage system.  There's plenty of information online (and here) comparing editions of the game in an incremental manner. But I'd be interested in a breakdown of how 2nd and 5th edition compare directly, specifically looking at whether there are broad areas of similarity. How do I force TeX to completely use the 1st column before writing to the second column?  Right now I dont have enough content to fill one whole page. So the left and right columns are equally filled, leaving 25% symmetrical empty page at bottom. How do I fill the left column first, and then the right?  \documentclass{article}  \usepackage{multicol} \usepackage[scale=0.9]{geometry} \usepackage{amssymb} \renewcommand{\labelitemi}{\tiny$\blacksquare$} \begin{document} \begin{multicols}{2}      %lots of text goes here  \end{multicols} \end{document} Does an electrolytic capacitor degrade each time it receives reverse voltage? I've found a nasty VBS way to do this, but I'm looking for a native PoSh procedure to edit the properties of a .LNK file.  The goal is to reach out to remote machines, duplicate an existing shortcut with most of the correct properties, and edit a couple of them.  If it would just be easier to write a new shortcut file, that would work too. How run a .jar file with a double-click? Prove that : $$\sum_{k=0}^{\infty} \frac{(-1)^{k}}{(2k+1)^3}=\frac{\pi^3}{32}.$$    I think this is known (see ), I appreciate any hint or link for the solution (or the full solution). Precise back-reference target with hyperref and backref How to find a global minimum for $\frac{1}{2}x^tQx-b^tx$ How to set environment variable in systemd service? I have an  and I've created my own service. The configuration service at /etc/systemd/system/myservice.service looks like this:  [Unit] Description=My Daemon  [Service] ExecStart=/bin/myforegroundcmd  [Install] WantedBy=multi-user.target   Now I want to have an environment variable set for the /bin/myforegroundcmd. How do I do that? I just finished backing up my system and when I try to upgrade to Utopic Unicorn, I get the error "Cannot Calculate the upgrades." I ran the upgrade by sudo apt-get dist-upgrade, sudo do-release-upgrade after the GUI method failed, they all gave the same error.  The feedback gives some recommendations:  This can be caused by:  * Upgrading to a pre-release version of Ubuntu  * Running the current pre-release version of Ubuntu  * Unofficial software packages not provided by Ubuntu    I am not upgrading to a pre-release version nor coming from one, I'm going from Ubuntu 14.04 LTS to 14.10. I have no broken packages and I have unchecked all my non-official software sources in the 'Software &amp; Updates' manager.  My guess left is the Unofficial software packages not provided by Ubuntu. If anyone could give any help as to how to check for unofficial packages using Synaptic or another, my appreciation.  Are there any other factors that may be causing this error and how would I go about checking/fixing those?  Thanks.  Edit: I have no broken or held packages. Everything is up-to-date, and restarting everything or anything has no effect. What do they do with all the plates and cups in Star Trek? How does the radius of a pipe affect the rate of flow of fluid? Poiseuille's law states that the rate of flow of water is proportionate to $r^4$ where $r$ is the radius of the pipe. I don't see why.  Intuitively I would expect rate of flow of fluid to vary with $r^2$ as the volume of a cylinder varies with $r^2$ for a constant length. The volume that flows past a point is equal to rate of flow fluid, and thus it should vary with $r^2$.  I cannot understand the mathematical proof completely. Is there an intuitive explanation for this? Getting started with ArcObjects? What is the best route or place to get started with ArcObjects if one is not a developer and not aiming to become a developer?  I've been using gis professionally for a long time, almost two decades, arcinfo/arcgis for most of that; I'm pretty good. I'm learning software development, and even have a modestly successful small python application used in a public project; I'm not good! I don't want to become a full fledged software developer but I keep running into things I just can't do without programming (). In the arcgis world this puts me pretty squarely in the python camp, which is fine by me since I like python, however python does not have straightforward access to ArcObjects. (Python and ArcObjects , but it's an unsupported route. This question is about following a beaten path.)  I need to get started, but where?  to get started with the  but $1500/yr is definitely not in my budget, and sounds like using a sledge hammer to swat mosquitos. And which language .NET, Visual Basic, or Visual C++?    UPDATE: Thank you everyone for the wonderful answers. In light of them I realise  I unecessarily narrowed the scope of my question be pre-supposing "ArcObjects" is the direction I need to go in. A more open ended formulation is more along the lines of:     I keep running into problems I just   can't solve with arcgis and python   alone. What else can I learn/use to   solve problems like X? I've no   interest or intention of becoming a   software developer. I just need to do   a couple things which aren't exposed   to the arcgis python modules.