🔒 Closed Mga php masters dyan..pa resbak po!

Status
Not open for further replies.

Netflix

Forum Veteran
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..
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>
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
             <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: &nbsp;&nbsp;&nbsp;&nbsp;<textarea name="fulldes" rows="8" cols="10" style="width: 600px;"></textarea></td>
         </tr>
        <tr>

            <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="price" placeholder="Price" required/></td>
            

 </tr>



<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="submit" name="submit" type="submit" class="btn btn-primary">
              <i class="icon-ok icon-white"></i>Add Product</button>



              &nbsp;&nbsp;&nbsp;

              <button type="reset" class="btn btn-danger">Cancel</button>

</td>
<tr>
<td style="height: 50px"> </td>
</tr>
</th>





</table></article>

upload_2017-3-14_13-33-13.webp


this is the error na nag aappear at hindi sya na papasok sa tables ko..

upload_2017-3-14_13-33-59.webp
 
Status
Not open for further replies.

About this Thread

  • 3
    Replies
  • 538
    Views
  • 3
    Participants
Last reply from:
Aries

Trending Topics

Online now

Members online
1,140
Guests online
1,046
Total visitors
2,186

Forum statistics

Threads
2,273,968
Posts
28,952,742
Members
1,235,011
Latest member
jhonrey30
Back
Top