Invalid parameter number: mixed named and positional parameters My desired goal here is to allow the uploading of images to the database through PHP, using PDO.   The database is not going to have a lot of values, at most ten to fifteen so I feel more comfortable with allowing the images to be uploaded there.  Here is my PHP code:  &lt;?php  require '../../app/start.php'; if (!empty($_POST)) { $name       = $_POST['name']; $position   = $_POST['position']; $detail     = $_POST['detail']; $imageData = addslashes(file_get_contents($_FILES['userImage']['tmp_name'])); $imageProperties = getimageSize($_FILES['userImage']['tmp_name']); $insertPage = $db-&gt;prepare(" INSERT INTO about (name, position, detail, imageType, imageData) VALUES (:name, :position, :detail, {$imageProperties['mime']}, {$imageData}) "); $insertPage-&gt;execute([ 'name'      =&gt; $name, 'position'  =&gt; $position, 'detail'    =&gt; $detail, 'imageType' =&gt; $imageProperties['mime'], 'imageData' =&gt; $imageData ]); } header('Location: ' . BASE_URL . '/admin/about/list.php'); require VIEW_ROOT . '/admin/about/add.php';  ?&gt;   and here is my HTML:  &lt;form action="&lt;?php echo BASE_URL; ?&gt;/admin/about/add.php" method="POST" enctype="multipart/form-data" autocomplete="off"&gt;         &lt;label for="name"&gt;             Name             &lt;input type="text" name="name" id="name" value=""&gt;         &lt;/label&gt;          &lt;label for="position"&gt;             Position             &lt;input type="text" name="position" id="position" value=""&gt;         &lt;/label&gt;          &lt;label for="detail"&gt;             Detail             &lt;textarea name="detail" id="detail" cols="30" rows="10"&gt;&lt;/textarea&gt;         &lt;/label&gt;          &lt;label for="imageId"&gt;             Upload Image File:             &lt;input name="userImage" id="userImage" type="file" class="inputFile" /&gt;         &lt;/label&gt;          &lt;input type="submit" value="Add Page"&gt;     &lt;/form&gt;   Table:  id  int(11) NO  PRI     auto_increment   imageId tinyint(3)  NO               imageType   varchar(25) YES              imageData   mediumblob  NO               name    varchar(35) NO               position    varchar(35) NO               detail  varchar(120)    NO                 I'm unsure if the above defines the table. I honestly am not familiar with what you are referring to.  These are the two errors I'm getting when I'm trying to upload the image:  Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters in /admin/about/add.php on line 24     Warning: Cannot modify header information - headers already sent by (output started at /admin/about/add.php:24) in /admin/about/add.php on line 26   Using this, I get a couple warnings and the image does not upload.   How can I fix my code to allow the uploading of images to the database?  Edit: I apologize, I previously copy and pasted the wrong html code.
How can I prevent SQL injection in PHP? 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?
Cannot reach public WIFI login page in Ubuntu 18.04 Captive Portal Issue If the universe is 3D, how is space-time like a "fabric"? data & synchronization - manually sync mail. calender and contacts How and why do accelerating charges radiate electromagnetic radiation? Let's consider it case by case:  Case 1: Charged particle is at rest. It has an electric field around it. No problem. That is its property.  Case 2: Charged particle started moving (it's accelerating). We were told that it starts radiating EM radiation. Why? What happened to it? What made it do this?  Follow up question: Suppose a charged particle is placed in uniform electric field. It accelerates because of electric force it experiences. Then work done by the electric field should not be equal to change in its kinetic energy, right? It should be equal to change in K.E + energy it has radiated in the form of EM Waves. But then, why don't we take energy radiated into consideration when solving problems? (I'm tutoring grade 12 students. I never encountered a problem in which energy radiated is considered.) How to stop Katoolin from crashing Ubuntu? How can I specify the default save directory for gnome-screenshot? Are there any sort of configuration options for specifying the default save location for gnome-screenshot, or is this hard-coded into the source code? It used to be ~/Desktop, which seems to have changed to ~/Pictures (in 12.04). The only possible solution I've seen is about  (as it includes time stamp information now instead of simply 'Screenshot#'), but that solution doesn't really seem ideal to me. Also,  post suggested that the last save location is remembered the next time you take a screenshot, but in my experience, this doesn't seem to be the case. And in any case, following on from that, that entry in gconf-editor doesn't even seem to accurately reflect the last location, so more than likely an entry related to an older version of gnome-screenshot. Table of contents: How to combine bold and "code sample" in Markdown? How can I make a word in a code sample bold? I only see asterisks around the expected bold text.  sample **sample** sample Why we use $L_2$ Space In QM? I asked this question for many people/professors without getting a sufficient answer, why in QM Lebesgue spaces of second degree are assumed to be the one that corresponds to the Hilbert vector space of state functions, from where this arises? and why 2-order space that assumes the following inner product:  $\langle\phi|\psi\rangle =\int\phi^{*}\psi\,dx$  While there is many ways to define the inner product.  In Physics books, this always assumed as given, never explains it, also I tried to read some abstract math books on this things, and found some concepts like "Metric weight" that will be minimized in such spaces, even so I don't really understand what is behind that, so why $L_2$? what special about them? Who and how physicists understood that those are the one we need to use? Without a physical form, what would Sauron have done had he recovered the Ring? Assuming one of Sauron's servants managed to recover the Ring, what exactly would Sauron do with it? He had no physical body to manipulate it and no finger to put it on. I guess he would have constructed a physical body for himself, but how? How would he get in "possession" of his Ring again? Just by a small enough distance between the Ring and the "Eye of Sauron"?  What would be the scenario of the event when one of Sauron's servants returns with the Ring? PHP not working after upgraded to Ubuntu 17.10 After I upgraded to Ubuntu 17.10, PHP totally stopped working. Everything works fine in Ubuntu 17.04. The code for info.php as follows does not work:   &lt;?php  phpinfo(); ?&gt;   It is not showing PHP information, it only shows the source code like above. Notify-send ignores timeout? Maybe I'm doing something wrong, but shouldn't the commands (run separately) notify-send -t 1 &quot;test&quot; notify-send -t 1000 &quot;test&quot; notify-send -t 10000 &quot;test&quot;  have different timeouts? The first being nearly instantaneous, the second taking 1 sec and the third 10 seconds? In all cases it seems to take about six seconds for me. Is there a way around this behaviour? As the developers label this as a &quot;feature&quot; instead of a bug, I would like some alternatives. How to deal with SQL column names that look like SQL keywords? One of my columns is called from. I can't change the name because I didn't make it. Am I allowed to do something like SELECT from FROM TableName or is there a special syntax to avoid the SQL Server being confused? Firefox suspicious subprocess (turned out to be legitimate FF behavior) I've discovered this yesterday, as it was generating system load on otherwise idle Ubuntu 14.04 Desktop machine.  Today, I've confirmed such behavior also on another Ubuntu instance (17.10 in Virtualbox VM)  The sub-process in command line looks like below ( I've put this as picture below intentionally to prevent askubuntu.com from changing/escaping the content )   For me it looks like exploit/malware. Or at least there is something to hide.  this happens even for url I have a group of objects of the same colour, consisting of compound paths, regular paths and groups of these. How to change the colour of all objects at once? When I tried to use colour picker or change it through color palette the colour remained the same but the graphics was rendered with a very tiny outline of the new colour, which I guess is not printable. Usually I had to change the colour of all objects individually.  Edit: I'm sorry if I was not too precise. I mean to apply new colour / swatch to all member objects of the group at once, not to change properties of a commonly shared swatch.    Edit 2: I received very useful answers, however my goal was to pick a colour from another object, serving as a source. When I tried to select all objects, for example with ctrl-a, and then use a eyedropper to pick up a desired colour, it didn't work for some objects in some groups. Please have a look at my answer where several methods are listed. For some tests in R, there is a lower limit on the  calculations of $2.22 \cdot 10^{-16}$. I'm not sure why it's this number, if there is a good reason for it or if it's just arbitrary. A lot of other stats packages just go to 0.0001, so this is a much higher level of precision. But I haven't seen too many papers reporting $p &lt; 2.22\cdot 10^{-16}$ or $p = 2.22\cdot 10^{-16}$.   Is it a common/best practice to report this computed value or is it more typical to report something else (like p &lt; 0.000000000000001)? How to work around Eclipse Luna/GTK bug 339174 (change to not use oxygen) The bug is described here:  For me it fails with:  java: /build/buildd/oxygen-gtk3-1.0.2/src/animations/oxygencomboboxdata.cpp:87: void Oxygen::ComboBoxData::setButton(GtkWidget*): Assertion `!_button._widget' failed.   Problem is if I go to GTK+ Apperance in Control Module and change to anything other than oxygen Eclipse will look totally awful.  Regardless what theme I use (tried QtCurve and Raleigh) it has the same look with huge padding around all controls etc.  Is it possible to have a sensible look without oxygen GTK?  I have kubuntu-desktop installed over the stock LTS distro.   $dpkg -l libgtk* | grep -e '^i' | grep -e 'libgtk-*[0-9]'     ii  libgtk-3-0                             3.4.2-0ubuntu0.8                          GTK+ graphical user interface library     ii  libgtk-3-bin                           3.4.2-0ubuntu0.8                          programs for the GTK+ graphical user interface library     ii  libgtk-3-common                        3.4.2-0ubuntu0.8                          common files for the GTK+ graphical user interface library     ii  libgtk2.0-0                            2.24.10-0ubuntu6.1                        GTK+ graphical user interface library     ii  libgtk2.0-bin                          2.24.10-0ubuntu6.1                        programs for the GTK+ graphical user interface library     ii  libgtk2.0-common                       2.24.10-0ubuntu6.1                        common files for the GTK+ graphical user interface library I listened to this on audiobook and it was great.  The premise was a human ends up travelling to an alien planet. The aliens have a perimeter to their 'base' that is under constant attack from the planet's animals. It is revealed towards the end that there is some sort of signal being transmitted that is making all the animals and plant life attack a certain point on the planet (where the aliens are).   Other major plot points I remember: The human traveller falls in love with an alien. The aliens have a sort of virtual training environment that simulates life outside the perimeter, where plants attack you etc. There is a secondary alien group that the human ends up with, and although they are rivals to other group, they have a trade set up.   Any help much appreciated! Thanks. How to typeset asymmetrical confidence level limits / uncertainties? reference overlay numbers with names Schedule to open website I'd like to open a website at regular intervals per day, i.e., the browser should open and automatically navigate towards a pre-set URL.  I looked at options like scheduling to open browser, but I can't figure out how to open it with a default URL. (No I do not want to make this my start page)  Any help is appreciated