Jump to content

seef

New Members
  • Posts

    2
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

seef's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for all the help. Barand I tried your solution but I get the following: Fatal error: Call to a member function real_escape_string() on a non-object in /home/definit1/public_html/athletics/insit.php on line 23 Any ideas?
  2. I have a PHP page called insert.php that inserts records via a page with a form named index.php. It works perfectly well but I can only add one record at a time. I would like to rewrite both scripts so that I can add many records a once and not one at a time. I am an absolute newbie and is completely stumped. Any ideas? Insert,php -------------------------------------- <?php // Create connection $con=mysqli_connect("localhost","root","password","results"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $sql="INSERT INTO 2014 (Pos,FirstName, LastName, Prov, Perf, Wind, Gender, Agegroup, Event, DOB, Meet, Venue, Date ) VALUES ('$_POST[pos]','$_POST[firstname]','$_POST[lastname]','$_POST[prov]','$_POST[perf]','$_POST[wind]','$_POST[gender]','$_POST[agegroup]','$_POST[event]','$_POST [dob]','$_POST[meet]','$_POST[venue]','$_POST[date]')"; if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error($con)); } echo "1 record added"; mysqli_close($con); ?> --------------------------------------------------- index.php <html> <body> <form action="insert.php" method="post"> Pos: <input type="text" name="pos"> Firstname: <input type="text" name="firstname"> Lastname: <input type="text" name="lastname"> Prov: <input type="text" name="prov"> Perf: <input type="text" name="perf"> Wind: <input type="text" name="wind"> Gender: <input type="text" name="gender"> Agegroup: <input type="text" name="agegroup"> Event: <input type="text" name="event"> DOB: <input type="text" name="dob"> Meet: <input type="text" name="meet"> Venue: <input type="text" name="venue"> Date: <input type="text" name="date"> <input type="submit"> </body> </html>
×
×
  • 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.