I am currently working on the store page for my website. I am connecting  to my database where data for the products is stored. The page has no user input, it just displays the data such as product name, price etc. My question is, can/should I implement prepared statements in order to prevent from SQL injection. If I can't use prepared statements are there any other forms of security I should implement in my website? Here is my current code:     &lt;?php  $connect = mysqli_connect('localhost', 'root','', 'cart'); $query = 'SELECT * FROM products ORDER by id ASC'; $result = mysqli_query($connect, $query);  if ($result):     if(mysqli_num_rows($result)&gt;0):         while($product = mysqli_fetch_assoc($result)):         ?&gt;                       &lt;div class=&quot;col-sm-4 col-md-3&quot; &gt;             &lt;form method=&quot;post&quot; action=&quot;view_product.php?action=add&amp;id=&lt;?php echo $product['id']?&gt;&quot;&gt;                 &lt;div class=&quot;products&quot;&gt;&lt;a href=&quot;view_product.php?product=&lt;?php echo $product['id'] ?&gt;&quot;&gt;                     &lt;img src=&quot;&lt;?php echo $product['image'];?&gt;&quot; /&gt;                     &lt;/a&gt;                     &lt;h4 class=&quot;text-dark&quot;&gt;&lt;a href=&quot;view_product.php?product=&lt;?php echo $product['id'] ?&gt;&quot;&gt;                         &lt;?php echo $product['name'];?&gt;                     &lt;/a&gt;                     &lt;/h4&gt;                     &lt;h4&gt;&lt;?php echo $product['price'];?&gt;&lt;/h4&gt;                 &lt;/div&gt;             &lt;/form&gt;         &lt;/div&gt;         &lt;?php                     endwhile;                 endif;           endif;             ?&gt;  When clicking on a certain product it redirects to another page where additional info is displayed for the particular product. I am using a query for that, could I use prepared statements for it? &lt;?php $query = 'SELECT * FROM products WHERE id = &quot;'.$_GET['product'].'&quot;'; ?&gt;  Thank you in advance!
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?
Maximize the product of the partitions of an integer How do I calculate the date six months from the current date using the datetime Python module? I am using the datetime Python module.  I am looking to calculate the date 6 months from the current date. Could someone give me a little help doing this?  The reason I want to generate a date 6 months from the current date is to produce a review date.  If the user enters data into the system it will have a review date of 6 months from the date they entered the data. Alternate proofs (other than diagonalization and topological nested sets) for uncountability of the reals? I recently started studying set theory and am having quite a bit of difficulty accepting Cantor's diagonal proof for the uncountability of the reals. I also saw a topological proof via nested sets for uncountability which still does not satisfy me completely, given that just like the diagonal it relies on a never ending process. In fact, the nested sets proof sounds very much like the diagonalization proof to me.  Do all proofs of the uncountability of the reals involve diagonalization? Are there any other proofs I can look at to understand? I couldn't find any on searching stack exchange. Thanks. Book about classical mechanics I am looking for a book about "advanced" classical mechanics. By advanced I mean a book considering directly Lagrangian and Hamiltonian formulation, and also providing a firm basis in the geometrical consideration related to these to formalism (like tangent bundle, cotangent bundle, 1-form, 2-form, etc.).  I have , but I would like to go into more details about the [symplectic] geometrical and mathematical foundations of classical mechanics.  Additional note: A chapter about relativistic Hamiltonian dynamics would be a good thing. Any idea why the piece of code below does not add the script element to the DOM?  var code = "&lt;script&gt;&lt;/script&gt;"; $("#someElement").append(code); Hello I am Indian Citizen currently studying in Australia and I am on a student visa. In the month of November 2019 I am travelling to India for vacations and I booked a ticket from Melbourne to Bangkok and than form Bangkok to India with a layover time of 7 hours in Bangkok and I am not going to leave the airport but my flights are different, so do I need to get and Airport Transit Visa in Bangkok. I'd like to remove my phone number from my iMessage account, but still have my phone enabled to receive messages sent to my email address (also used on iPad, Mac). Is there a way of doing this? Difference between 'max distance' and 'radius' in Physics.SphereCastAll What is the difference between \em and \emph? What is the difference between \emph{...} and {\em ...}?  When to use each of them? I'm using tex4ht to produce XHTML files from a LaTeX file. The XHTML file I obtain uses images for some equations which tex4ht could not convert directly to XHTML.   Problem: images of equations have very bad quality.   What I want: Better quality images.  More info on attempts &amp; system:  I'm using MikTeX 2.9 under Windows Vista. I go to the command line and type htlatex document.tex "xhtml" to get the resulting XHMTL file.   After doing some search on the web, I tried to change the file tex4ht.env as mentioned in  (changing -density 110x100 to -density 220x220 -geometry 50%) in all locations I could find in my system (within the MikTeX path and also in the AppData windows directory) but the results are the same. I obtain during the compilation of hlatex the following line (among others):     System call: mgs -sDEVICE=pngalpha -sOutputFile=Untitled11x.png   -r110x110 -dEPSC rop -dBackgroundColor=16#ffffff -dTextAlphaBits=2 -dGraphicsAlphaBits=2 -q -dbat ch -dNOPAUSE zzUntitled1.ps -c quit   In particular, I would guess that the -r110x110 means resolution was still set to 110x110, despite my changes to the file tex4ht.env.  Any suggestions on how to improve the quality of equations images? Installation of Ubuntu 16.04 blocked: cannot find hard disk I am trying to install Ubuntu 16.04 LTS on a Dell XPS 13 (9350). The laptop came with Windows 10 pre-installed. I am installing from a pendrive but I think the issue would be the same if I used e.g. a USB DVD drive.   Dude, where's my hard drive?  I am blocked because the installation program cannot find 8.6Gb of free space on my hard drive despite the fact that there are hundreds of Gb free according to Windows. Digging a bit into the problem, it seems that Ubuntu cannot see my hard disk at all.    This is the output of GParted:    I am not sure what that drive mounted at /cdrom is, but it seems the only device that exists in the system that is not a RAM disk or a loop device:   Content of /proc/partitions:   ubuntu@ubuntu:~$ cat /proc/partitions   major minor  #blocks  name     1        0      65536 ram0     1        1      65536 ram1     1        2      65536 ram2     1        3      65536 ram3     1        4      65536 ram4     1        5      65536 ram5     1        6      65536 ram6     1        7      65536 ram7     1        8      65536 ram8     1        9      65536 ram9     1       10      65536 ram10     1       11      65536 ram11     1       12      65536 ram12     1       13      65536 ram13     1       14      65536 ram14     1       15      65536 ram15     7        0     130048 loop0     7        1    1104188 loop1     8        0    1970239 sda     8        1    1953439 sda1   Summary of fdisk -l:   ubuntu@ubuntu:~$ sudo fdisk -l |grep Disk Disk /dev/ram0: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram1: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram2: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram3: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram4: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram5: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram6: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram7: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram8: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram9: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram10: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram11: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram12: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram13: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram14: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/ram15: 64 MiB, 67108864 bytes, 131072 sectors Disk /dev/loop0: 127 MiB, 133169152 bytes, 260096 sectors Disk /dev/loop1: 1.1 GiB, 1130688512 bytes, 2208376 sectors Disk /dev/sda: 1.9 GiB, 2017525248 bytes, 3940479 sectors Disklabel type: dos Disk identifier: 0x00000000   Result of fdisk of the only non-loop non-RAM device (not sure this is relevant):   ubuntu@ubuntu:~$ sudo fdisk -l |grep -A 50 sda Disk /dev/sda: 1.9 GiB, 2017525248 bytes, 3940479 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x00000000  Device     Boot Start     End Sectors  Size Id Type /dev/sda1  *      129 3907007 3906879  1.9G  c W95 FAT32 (LBA)   I am blocked at this point. Any help will be much appreciated.   Additional information (following comments):   Running dmesg |grep -i sata shows (among others) eight lines that suggest some kind of error:   ata1: SATA link down (SStatus FFFFFFFF SControl FFFFFFFF) ata2: SATA link down (SStatus FFFFFFFF SControl FFFFFFFF) ata3: SATA link down (SStatus FFFFFFFF SControl FFFFFFFF) ata4: SATA link down (SStatus 0 SControl 0) ata5: SATA link down (SStatus 0 SControl 0) ata6: SATA link down (SStatus 0 SControl 0) ata7: SATA link down (SStatus 0 SControl 0) ata8: SATA link down (SStatus 0 SControl 0)  I have "Restarted" windows instead of only "Shutdown" it to avoid problems with "fast startup", following some recommendations I have read of other users having problems installing Linux on Windows 10 laptops.ago   Regarding SATA, the BIOS says: "SATA Operation: RAID ON". The other two options available are "Disabled" and "AHCI".    I have followed the instructions of these two pages from Dell: , . Kids' fantasy movie from the 80s or 90s? Should spam posts be edited? How can I improve Ubuntu overall system performance? I really get confused when to use say and when to use tell. Which is appropriate in the following:   What did he tell? / What did he say? What are you saying? / What are you telling? Do I need a bus/train/plane ticket out of Thailand in order to get a Visa-on-Arrival? Why do neural networks need so many training examples to perform? A human child at age 2 needs around 5 instances of a car to be able to identify it with reasonable accuracy regardless of color, make, etc. When my son was 2, he was able to identify trams and trains, even though he had seen just a few. Since he was usually confusing one with each other, apparently his neural network was not trained enough, but still.  What is it that artificial neural networks are missing that prevent them from being able to learn way quicker? Is transfer learning an answer? As far as I know, current division for spesific place's formula is: Ix=(Req/Rx)*Isource   However, here,the solution is 3/(3+2+4)*6. How is this a current division ? Can you explain this to me Every Group is a Fundamental Group When to use Stateful session bean over Stateless session bean?