I made a class that connects to my DB and inserts some values. Is it secure or how can I protect this further from injections? The object declaration will come from variables with POST from a form, after being validated, ofc. Just want to know if this is secure.  &lt;?php include "db/db_info.php"; /*$DBServer $DBUser $DBPass $DBName*/ class WorkDB {     private $server;     private $user;     private $pass;     private $name;     private $conn;      public function __construct( $server, $user, $pass, $name ) {         $this-&gt;server=$server;         $this-&gt;user=$user;         $this-&gt;pass=$pass;         $this-&gt;name=$name;     }      public function tryconn() {         $this-&gt;conn = new mysqli(  $this-&gt;server, $this-&gt;user, $this-&gt;pass, $this-&gt;name );      if ( $this-&gt;conn-&gt;connect_error ) {         die( 'Connection Error (' . $this-&gt;connconnect_errno . ') '                 . $this-&gt;conn-&gt;connect_error );     }       else echo 'ok';  }  public function query_register( $user, $pass, $email ) {     $stmt = $this-&gt;conn-&gt;prepare( "INSERT INTO `users` (`username`, `password`, `email`) VALUES (?, ?,?)" );     $stmt-&gt;bind_param( "sss", $user, $pass, $email );     $stmt-&gt;execute();     $stmt-&gt;close(); }   }//end of class   $a=new WorkDB( $DBServer, $DBUser, $DBPass, $DBName ); $a-&gt;tryconn(); $a-&gt;query_register( 'a', 'b', 'c' );   ?&gt;
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?
Why can I not place a pregnant woman to work but others work while pregnant? I am playing Fallout Shelter, have 3 kids in my shelter, all going well, thought I would make one more kid with big strength numbers and decent agility/perception (kids take on SPECIAL stats from their parents). All the women who are pregnant work in my shelter, apart from this one. She can not me put to work, can not be moved from the living shelter, can not be moved to a job via the clipboard short cut.  TL;DR One of the NPC females who is pregnant can not be put to work, can not be moved from the living shelter room, she just walks about as if she is carrying a mammoth inside her. I have NOT moved the shelter, have not let the dad die, have not done anything at all. How does DC work with natural 20? Windows Update not working on Windows 2012 R2 Standard I recently inherited the management of a Windows 2012 server at a remote site.    I checked Windows Update and it has not been updating since March.  When I tell Windows to check for updates, it acts like it is checking, but it seems to say that for hours.   If I attempt to restart the windows update service, it seems to never be able to shut down.  My only remedy seems to be rebooting to get back to the point where I can tell Windows Update to check for new updates.    The last successful check for updates says March 20.  The last time updates were installed says March 17 (failed).  The update history shows that one update failed for March 17, a printer driver update, but the history shows 13 failed updates for Feb 17.  Not sure what else to try. Control Cycles/Eevee material nodes and material properties using python? How can I define the different properties of an Cycles/Eevee material? Such things as glossy, glass, diffuse, RGB-color, emissive via python scripting? If $A\simeq\prod A_i$ then $\sum e_i=1$ Given $A$ commutative ring with unity. If we have rings $A_1,\dots, A_n$such that $A\simeq A_1\times \dots \times A_n$ there are $e_1,\dots,e_n$ idempotent elements of $A$ such that $e_1+\dots+e_n = 1$ and $e_i e_j =0$ if $i\neq j$.  I'm not sure how general the proof should be written...  The isomorphic relation suggest that if $f$ defines the isomorphism then there is a $(a_1,\dots, a_n)\in \prod A_i$ such that $f(a_1,\dots,a_n)=1\in A$. Could it work thinking of the idemmpotent terms as $e_i=(0,\dots,0, a_i,0, \dots,0)?$ This should satisfy $e_i e_j =0$ if $i\neq j$. But I have two problems with it (1) I don't see why $e_i$ should idempotent as no assumptions in regard to the existence of idempotent elements in $A_i$ has been made. (2) The sum $\sum e_i=1$ has no reason to be true. $\sum_i x_i^n = 0$ for all $n$ implies $x_i = 0$ Here is a statement that seems prima facie obvious, but when I try to prove it, I am lost.  Let $x_1 , x_2, \dots, x_k$ be complex numbers satisfying:  $$x_1 + x_2+ \dots + x_k = 0$$  $$x_1^2 + x_2^2+ \dots + x_k^2 = 0$$  $$x_1^3 + x_2^3+ \dots + x_k^3 = 0$$  $$\dots$$  Then $x_1 = x_2 = \dots = x_k = 0$.    The statement seems obvious because we have more than $k$ constraints (constraints that are in some sense, "independent") on $k$ variables, so they should determine the variables uniquely.  But my attempts so far of formalizing this intuition have failed.  So, how do you prove this statement?  Is there a generalization of my intuition? Exclamation(!) turned in to question mark(?) in title field I just submitted a question () with an exclamation (!) at the end of the title (with one space between the word and the exclamation) but it turned in to question mark (?).   I removed the space between the word and the exclamation, then it shows normal.   Is this an intended feature? It is well known from Noether's Theorem how from continuous symmetries in the Lagrangian one gets a conserved charge which corresponds to linear momentum, angular momentum for translational and rotational symmetries and others.  Is there any elementary argument for why linear or angular momentum specifically (and not other conserved quantities) are conserved which does not require knowledge of Lagrangians? By elementary I mean, "if this is not so, then this unreasonable thing occurs".   Of course, we can say "if we want our laws to be the same at a different point in space then linear conservation must be conserved", but can we derive mathematically the expression for the conserved quantity without using the Lagrangian?  I want to explain to a friend why they are conserved but he doesn't have the background to understand the Lagrangian formalism. How can Zeno's dichotomy paradox be disproved using mathematics? A brief description of the paradox taken from :     Suppose Sam wants to catch a stationary bus. Before he can get there, he must get halfway there. Before he can get halfway there, he must get a quarter of the way there. Before traveling a quarter, he must travel one-eighth; before an eighth, one-sixteenth; and so on.      This description requires one to complete an infinite number of tasks, which Zeno maintains is an impossibility. This sequence also presents a second problem in that it contains no first distance to run, for any possible (finite) first distance could be divided in half, and hence would not be first after all. Hence, the trip cannot even begin.      The paradoxical conclusion then would be that travel over any finite   distance can neither be completed nor begun, and so all motion must be   an illusion.   How can this be disproved using math, as obviously we can all move a walk from one place to another? What is the state-of-the-art method for automatically executing custom scripts upon USB device plug-in under current Linux distributions like Debian/CentOS/Fedora?  For example if you want to automatically mount/copy some files/umount a USB mass storage device based on its UUID (or device ID etc.). how to convert NTFS to ext4 in windows? How do I make a floor plan with specific dimensions? This is my very first time of using blender. I've tried several tutorials but can't find anything that tells me how to do the very basic thing i want to do.  I simply want to draw a floor plan for a room which is 13 feet by 11 feet and make it 3d so that ultimately i can play with where things go in that room.  Can anyone take me through the steps needed to do this?   I will be so grateful.  Thank you in advance HTTP vs HTTPS performance Are there any major differences in performance between http and https?  I seem to recall reading that HTTPS can be a fifth as fast as HTTP.  Is this valid with the current generation webservers/browsers?  If so, are there any whitepapers to support it? How is "I have come" + infinitive different from Present Perfect? Shape with a slanted side (responsive) Valid references on origins of Machine Learning, Statistical Learning and Data Mining Drawing arrows on an HTML page to visualize semantic links between textual spans I have an HTML page with some textual spans marked up something like this:  ... &lt;span id="T2" class="Protein"&gt;p50&lt;/span&gt; ... &lt;span id="T3" class="Protein"&gt;p65&lt;/span&gt; ... &lt;span id="T34" ids="T2 T3" class="Positive_regulation"&gt;recruitment&lt;/span&gt; ...   I.e. each span has an ID and refers to zero or more spans via their IDs.  I would like to visualize these references as arrows.  Two questions:   How can I map an ID of a span to the screen coordinates of the rendering of the span? How do I draw arrows going from one rendering to another?   The solution should work in Firefox, working in other browsers is a plus but not really necessary. The solution could use jQuery, or some other lightweight JavaScript library. Programmatically combining images in PHP I'm a big fan of Yahoo's  for speeding up websites. One of the recommendations is to combine images where possible to cut down on size and the number of requests. However, I've noticed that while it can be easy to use CSS sprites for layouts, other image uses aren't as easily combined. The primary example I'm thinking of is a blog or article list, where each blog or article also has an image associated with it. Those images can greatly affect load time and page size, especially if they aren't optimized. What I'm looking for, in concept or in practice, is a way to dynamically combine those images while running them through a loss-less compression using PHP.   A few added thoughts or concerns:   Combining the images and generating a dynamic CSS stylesheet to position the backgrounds of the images might be one way to go about it, but I also worry about accessibility and semantics. As far as I understand, CSS images should be used for layout elements and the img tag (with the alt attribute) should be used for images that are meant to convey information. I could set the image as a background to a div element and substitute a title attribute for the alt attribute, but I'm unsure about the accessibility and semantic implications of doing so. Might the GD library be a good candidate for something like this? Can you recommend other options? How do I "parent" objects? I'm looking for a way to have two separate objects be connected, so that when I move the first object the second one will move also. The term parent is used, but how do I parent a object? How do I remove an OpenID or login? How do I remove login credentials (emails or OpenIDs) from my account?     For more information, see "" in the .