Note that there are some explanatory texts on larger screens.

plurals
  1. POWarning: File upload error - unable to create a temporary file in Unknown on line 0
    primarykey
    data
    text
    <p>Am getting the following error everytime I try to upload a file . </p> <p>"Warning: File upload error - unable to create a temporary file in Unknown on line 0"</p> <p>Here is my HTML form,</p> <pre><code>&lt;form action="./inventory_list.php" enctype="multipart/form-data" name="myForm" id="myForm" method="post"&gt; &lt;table width="625" border="1" cellpadding="5"&gt; &lt;tr&gt; &lt;td width="84"&gt;Product Name&lt;/td&gt; &lt;td width="399"&gt;&lt;input type="text" name="product_name" id="product_name"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Product Price&lt;/td&gt; &lt;td&gt;&lt;label for="textfield2"&gt;Rs:&lt;/label&gt; &lt;input type="text" name="price" id="price"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Category&lt;/td&gt; &lt;td&gt;&lt;select name="category" id="category"&gt; &lt;option value="" selected="selected"&gt;&lt;/option&gt; &lt;option value="Bedroom "&gt;Bedroom &lt;/option&gt; &lt;option value="Living"&gt;Living room&lt;/option&gt; &lt;option value="Dining"&gt;Dining&lt;/option&gt; &lt;/select&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Sub - Category&lt;/td&gt; &lt;td&gt;&lt;select name="subcategory" id="subcategory"&gt; &lt;option value="" selected="selected"&gt;&lt;/option&gt; &lt;option value="dinet"&gt;Dining tables&lt;/option&gt; &lt;option value="shoe"&gt;shoe racks&lt;/option&gt; &lt;option value="wardrobe"&gt;wardrobes&lt;/option&gt; &lt;option value="sofa"&gt;sofa&lt;/option&gt; &lt;/select&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Product Details&lt;/td&gt; &lt;td&gt;&lt;textarea name="details" cols="50" rows="10" id="details"&gt;&lt;/textarea&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Product Image&lt;/td&gt; &lt;td&gt;&lt;label&gt; &lt;input type="file" name="fileField" id="fileField"/&gt; &lt;/label&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;td&gt;&lt;input type="submit" name="button" id="button" value="Add this Item now"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/br&gt; &lt;/form&gt; </code></pre> <p>Here is my PHP code ,</p> <pre><code>if(isset($_POST["product_name"])) { $product_name = mysql_real_escape_string($_POST["product_name"]); $price= mysql_real_escape_string($_POST["price"]); $category= mysql_real_escape_string($_POST["category"]); $subcategory= mysql_real_escape_string($_POST["subcategory"]); $details= mysql_real_escape_string($_POST["details"]); //see if duplicate product exists $sql = mysql_query("select id from products where product_name='$product_name' limit 1"); $product_match = mysql_num_rows($sql); //count the output if($product_match&gt;0) { echo "The product name already exists"; exit(); } $sql= mysql_query("INSERT INTO `mystore`.`products` (`product_name`, `price`, `details`, `category`, `subcategory`, `date_added`) VALUES ( '$product_name', '$price', '$details', '$category', '$subcategory', now());")or die(mysql_error()); $pid = mysql_insert_id(); $newname = "$pid.jpg"; move_uploaded_file($_FILES['fileField']['tmp_name'],'../inventory_images/$newname'); } </code></pre> <p>Am trying to upload on localhost , Test Server:XAMPP , OS : MAC 10.8</p> <p>Am stuck on this from a long time , I tried a lot of things but nothing is working . </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload