May problema po ako sa codes di ko matukoy kung anung problema neto..
database name ko="camshop"
table kung saan ko iinsert ang data="products"
ito yung sa action ng form ko..
this the input tags..
View attachment 145781
this is the error na nag aappear at hindi sya na papasok sa tables ko..
View attachment 145783
database name ko="camshop"
table kung saan ko iinsert ang data="products"
ito yung sa action ng form ko..
Code:
//this is the productsave.php
<?php
include('dbcon.php');
if (isset ($_POST['submit']))
{
$p_name=$_POST['pname'];
$description=$_POST['description'];
$fulldes=$_POST['fulldes'];
$price=$_POST['price'];
mysqli_connect("localhost", "root", "","camshop")
or die ('Unable to connect');
$query="INSERT INTO products
('p_name','description','description','fulldes','price')
VALUES ('$p_name','$description','$fulldes','$price') ";
mysql_query($query) or die("Opps Something Wrong");
?>
<script> alert ('Product has been added!');
window.location="index.php";
</script>
<?php
}
?>
this the input tags..
Code:
<form method="post" action="productsave.php">
<table cellspacing="10px" cellpadding="4">
<h3>Add Product</h3>
<tr>
<td>
<input type="text" name="pname" placeholder="Product name">
</td>
</tr>
<!--OPTIONSSS-->
<tr>
<tr>
<td>Product Specifications:
<textarea name="description" rows="8" cols="10" style="width: 600px;height: 50px;"> </textarea>
</td>
<tr>
<td colspan="2">Product Description: <textarea name="fulldes" rows="8" cols="10" style="width: 600px;"></textarea></td>
</tr>
<tr>
<td> <input type="text" name="price" placeholder="Price" required/></td>
</tr>
<tr><td> <button id="submit" name="submit" type="submit" class="btn btn-primary">
<i class="icon-ok icon-white"></i>Add Product</button>
<button type="reset" class="btn btn-danger">Cancel</button>
</td>
<tr>
<td style="height: 50px"> </td>
</tr>
</th>
</table></article>
View attachment 145781
this is the error na nag aappear at hindi sya na papasok sa tables ko..
View attachment 145783
