I'm creating a commenting system for signed in users. It is very simple, I just want the user's username and the comment posted on the page and then stored in my user_comments table.       I have two db tables I am working with users and user_comments. All of the username info is stored in my users table. I want the comments to be stored into the user_comments section and post from there. Then I want the user's username to be echod next to the comment and then stored in with the user_comments after submitted. I can't figure out how to sync all of this together. As of now this posts and the comment stores into my user_comments.   How would I get the user's username to post and then be stored into the user_comments table?  &lt;form action="communitySignedIn.php" method="POST"&gt;     &lt;label for="comment"&gt;Comment&lt;/label&gt;     &lt;textarea cols="15" name="comment" placeholder="Message" class="messageinput" rows="5" maxlength="1000" required&gt;&lt;/textarea&gt;&lt;br&gt;      &lt;input type="hidden" name="token" value="&lt;?php echo Token::generate(); ?&gt;"&gt;     &lt;input id="signinButton" name="submit" type="submit" value="Comment"&gt; &lt;/form&gt;&lt;br&gt;&lt;br&gt;  &lt;?php     if(isset($_POST['submit'])){          $comment = trim( $_POST['comment'] );;          $okay = true;             if( strlen($comment) &lt; 2 ) {              echo "Please enter another character&lt;br&gt;";              $okay = false;          }          // you would do other validation here if other fields          if ( $okay ) {              $con = mysqli_connect("localhost", "root", "", "bfb");              $q = mysqli_query($con,"INSERT INTO user_comments (id, comment) VALUES ('', '$comment')")                  or die("Could not INSERT: " . mysql_error());              echo "Your comment was successfully posted.&lt;br/ &gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;";          }      } ?&gt; &lt;?php     $con = mysqli_connect("localhost", "root", "", "bfb");     $run = mysqli_query($con,"SELECT * FROM user_comments ORDER BY id DESC");     $numrows = mysqli_num_rows($run);     if($numrows &gt; 0){         while($row = mysqli_fetch_assoc($run)){             $dbname = $row['name'];             $dbcomment = $row['comment'];             echo 'escape($user-&gt;data()-&gt;username)';             echo "Comment: $dbcomment&lt;br&gt;&lt;br&gt;&lt;hr&gt;";         }     }     else         echo "No Comments Found..."; ?&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?
How can I recover photo files from a memory card with a corrupt filesystem? I just came over this syntax in some of the questions in this forum, but Google and any other searchengine tends to block out anything but letters and number in the search so it is impossible to search out "=>".  So can anyone tell me what it is and how it is used? How can you tell when a roast is done? How can you tell when a roast is done?  How long should they roast for? I am a little bit confused by early stopping and in particular by how it can be inserted inside a CV framework. As far as I understand, I can fix the optimal number of epochs (for NN, or number of trees for XGB) by early stopping, that is:   pick a validation set, train with increasing number of epochs until a predefined metric evaluated on the validation set starts worsening that is the optimal number of epochs to prevent overfitting   and that's fine. But then I would like to insert this early stopping framework inside a CV framework: Suppose I have a model with 10 hyperparameters I want to fix via CV. And suppose that there is an eleventh hyperparameter, the number of epochs. My feeling is that one can do like this:   create the K resampled folds, for each of which you have a training and validation set choose a suitable grid for your 10 hyperparameters for each point on the grid train your model in each fold with early stopping, that is use the validation set of the fold to keep track of the preferred metric and stop when it gets worse take the mean of the K validation metric choose the point of the grid (i.e. the set of hyperparameters) that gives the best metric   Questions:   What number of epochs should I choose as optimal? in each of the K folds I have, in general, a different number of stopping epochs.  seems to suggest they take the mean of the K stopping epochs. Is this right? Is it actually a "fair" practice to use the validation metric coming from the early stopping as a proxy of the out-of-sample metric? As  in section 3.4.5, maybe the best thing to do would be:     ...if you want to do early stopping, then in each fold you should take your training set and split it again, holding out a small early-stopping-set to guide the early stopping, and then evaluate the model on the validation set of that fold.   But this seems to me a really intricate process...   Unfortunately, I wasn't able to find references where this issue is presented in a clear and transparent form. If matrix A is invertible, is it diagonalizable as well? If a matrix A is invertible, then it is diagonalizable. Is it true or false? I’m writing a document in the latex and it contains some BNF grammar noations in several places of the documents. (I used verbatim package in order to write these BNF grammar notations)  Now I want to add a new section to the document that shows name of all grammar notation and their page numbers. This should be similar to “List of Figures” page.  I’m new to Latex and your help will be very helpful for me.  Thanks Adding feature class to Map in CURRENT project using ArcPy in ArcGIS Pro? How to evaluate the integral $\int_0^{\pi}\frac{a^n\sin^2x+b^n\cos^2x}{a^{2n}\sin^2x+b^{2n}\cos^2x}dx$? Evaluate the integral $$\int_0^{\pi}\frac{a^n\sin^2x+b^n\cos^2x}{a^{2n}\sin^2x+b^{2n}\cos^2x}dx.$$   I have no idea.   $$\int_0^{\pi}\dfrac{a^n\sin^2x+b^n\cos^2x}{a^{2n}\sin^2x+b^{2n}\cos^2x}dx=\int_0^{\pi/2}\dfrac{a^n\sin^2x+b^n\cos^2x}{a^{2n}\sin^2x+b^{2n}\cos^2x}dx=\int_0^{\pi/2}\dfrac{a^n\tan^2x+b^n}{a^{2n}\tan^2x+b^{2n}}dx$$  I try the substitution $\tan{x}=t$, but it doesn’t work. Start a git commit message with a hashmark (#) In the Harry Potter world, there's the term "muggle" for people with no magical abilities, "muggle-born" for those with magical abilities who's parents are muggles and "squib" for those with no magical abilities who's parents are magical.  But is there any collective term for all magical people (as opposed to wizards for males and witches for females)?  I don't recall seeing any word that refers to all men and women and children with magical abilities, and it's the only group left without noun or collective noun to describe them. What is the difference between #include  and #include "filename"? In the C and C++ programming languages, what is the difference between using angle brackets and using quotes in an include statement, as follows?   #include &lt;filename&gt;  #include "filename" Negative y value in polar plot I'm having some trouble with polar plots. I have to plot negative values, but without changing direction. I tried to set the ymin value to be negative, but it doesn't work.  \documentclass[10pt,border=10pt]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{polar}  \begin{document} \begin{tikzpicture} \begin{polaraxis}[    xticklabel=$\pgfmathprintnumber{\tick}^\circ$,    ymin=-10,    xtick={0,30,...,330}] \addplot table{    0  -1     30 -2    45 -3    60 -4    75 -5    }; \end{polaraxis} \end{tikzpicture} \end{document}   Any suggestion?  For clarity, this is what I expected. I'm writing a mildly dystopian scenario where competition is taken to vicious extremes, and I was wondering if there was a word that I could use (specifically a noun that was a synonym of "competition") to describe the sort of vicious, cutthroat ... _________ (the word that I want) that was going on.  I'm specifically looking for a word that doesn't refer to a one-off event (like "contest" or "tug-of-war"), but rather is more about the state of things. How to make a through hole using inward extrusion in Blender 2.8? I am trying to make a through hole using inward extrusion. I enterd into edit mode, then I drawed an outline of my hole using knife tool. then I turn into wireframe shading, rotate my view an select snap to faces and then extrude the hole outline inward  so the hole is created successfully, but I still have a face at the hole bottom. I can select this face separately  But If I try to delete it, I siply delete this face (I can't select it anymore after deleteting), but I do not see through hole, so the basic cube face is still here. So how to remove the hole bottom? Why are mirrorless cameras much slower than DSLRs? This is a follow-up to a .  I've been comparing cycle times (or shot to shot times in single shot mode) of mirrorless cameras with interchangeable lenses with traditional DSLRs and all of them, even the highest end ones (like the Olympus OM-D EM-5 or Panasonic GH3) are slower than even entry level DSLRs.  How's that possible? The electronics should be the same and they don't have the burden of a mirror going up and down between each shot. I think that there must be a technical reason for that (maybe some cpu time is going to feed the live-view before the image is encoded?), because from a commercial point of view it does not make sense.  I've seen the cycle times under the performance tab in the reviews pages of .  The average CSC has cycle times around 0.7~1.2s, the flagship ones around 0.5s. The average DSLR has cycle times around 0.4s and the flagships around 0.25s. Prove that $\mathbb{|Q| = |Q\times Q|}$ Do you ever center AND standardize variables in multiple regression? It seems as if standardization would automatically center variables...is this true? xticks steps using Pgfplots / dateplot I am trying to INSERT INTO a table using the input from another table. Although this is entirely feasible for many database engines, I always seem to struggle to remember the correct syntax for the SQL engine of the day (, , , , and ).  Is there a silver-bullet syntax coming from an SQL standard (for example, ) that would allow me to insert the values without worrying about the underlying database? Problem with PDO MySQL For the last couple of days I've been getting the following error:     Fatal error: Undefined class constant 'MYSQL_ATTR_USE_BUFFERED_QUERY' in /home/mydomain/public_html/drupal/includes/database/mysql/database.inc on line 46   This comes after my Hosting did an upgrade and PHP is now version 5.2.17.  From what they have told me, I think I have to enable a PDO MySQL extension in php.ini.  The problem is I'm on a shared hosting and I don't have access to the file; also, my Hosting said they can't change it either.  My info.php shows:     PDO      PDO support enabled      PDO drivers sqlite, sqlite2        pdo_sqlite      PDO Driver for SQLite 3.x enabled      PECL Module version (bundled) 1.0.1 $Id: pdo_sqlite.c 293036 2010-01-03 09:23:27Z   sebastian $      SQLite Library 3.3.7     I tried modifying the .htaccess file and/or adding my own php.ini file to the root directory per some suggestions I found, but nothing I've tried has worked yet.  Can anyone please suggest what else I could do?  EDIT:  Once again I asked the Hosting to enable PDO_MySQL extension and their answer was that they could not, that cPanel (to which they migrated from Plesk, causing this whole problem) had this extension disabled by default and changing it would affect their servers.  Their solution?  That I would change my programming to adjust to these new features, which I wouldn't even know how to go about.  Are they right requesting that I do this? Is there any other way?