Jump to content

zed_fuma

New Members
  • Posts

    5
  • Joined

  • Last visited

zed_fuma's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i edited the post, I managed to do the thing about the insert. by errors I mean these ones:
  2. someone helped me a bit and now it at least adds something in the database. indeed I didn't make it clear, yes since I made checkboxes I want to put more genres to a movie. and yes you are right, it only shows the last one. in the end the person who helped me also told me I should use mysqli and I changed the php part a bit to: <?php $a=mysqli_connect('localhost', 'root', 'root', 'movies') or die(mysqli_error($a)); if (!$a){ echo mysqli_connect_errno().mysqli_connect_error(); } $c=$_POST["Name"]; $d=$_POST["img"]; $e=$_POST["trailer"]; $f=$_POST["air"]; $g=$_POST["airdate"]; $h=$_POST["rate"]; $i=$_POST["genre"]; $j=$_POST["description"]; $sql="INSERT INTO movie(name,img,trailer,air,airdate,rate,genre,description) VALUES('$c','$d','$e','$f','$g','$h','$i','$j')"; mysqli_query($a,$sql) or die(mysqli_error($a)); echo ''; ?> now I only have the problem with the genres, and the errors that distort the page. managed to do something about adding empty lines whenever I load the page with if(isset($_POST['sub'])) where sub is the name for the submit button.
  3. what I need is mysql not mysqli or pdo. I need it for school and at school we make mysql and the teacher will know it's not mine if I use something like this. also I don't need all those error checks and other things yet, I'm keeping it simple for now, I'll take it one step at a time. I attached the files and I just want to know what I did wrong or what I need to correct and how.
  4. Hi! Can anyone help me with this? I'm pretty much a newbie in php and mysql but I have a project to make for school so I need it. As the topic title says I just simply want to add the data collected through the form on the insert.php page directly in the database. I tried to change " with ' or other stuff but it doesn't work. I use xampp server by the way. template.css insert.php
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.