Jump to content

keykeeper

Members
  • Posts

    7
  • Joined

  • Last visited

About keykeeper

  • Birthday 12/18/1987

Profile Information

  • Gender
    Male
  • Location
    N.Ireland
  • Country
    United States

keykeeper's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. so got it to add names to database. any ideas on how to count and display list on a page now ?
  2. so i been trying this <?php if (isset($_POST['submit'])) { if(empty($_POST['fname'])) { die("Fill in the first name field."); } if(empty($_POST['lname'])) { die("Fill in the last name field."); } include('connect-mysql.php'); $fname = mysqli_real_escape_string($dbcon,trim($_POST['fname'])); $lname = mysqli_real_escape_string($dbcon,trim($_POST['lname'])); $sqlinsert = "INSERT INTO `users` (firstname, lastname) VALUES ('" . $fname . "','" . $lname . "')"; if (!mysqli_query($dbcon, $sqlinsert)) { die('error inserting new record'); } //end of nested if echo "1 record added to the database"; } // end of the main if statement ?> <html> <head> <title>Insert Data into DB</title> </head> <body> <hl>Insert Data into DB</hl> <form method="post" action=""> <fieldset> <legend>New People</legend> <label>First Name:<input type="text" name="fname" /></label> <label>Last Name:<input type="text" name="lname" /></label> </fieldset> <br /> <input type="submit" name="submit" value="add new person" /> </form> <?php echo $newrecord; ?> </body> </html> how ever i keep getting ( error inserting new record ) what do i need to create in the table ? and how do i display it then ? any help would be great
  3. hi all i am looking to set up a simple php page the idea is that someone would come on to the web page and see a form like add name ( textbox ) click send ( button ) once they add there name i want to display it in a table below and have a counter which will count up the number of names on the list automatically any ideas on how i could do this ? it a very simple idea and i know it would be simple to make but not sure how too
  4. very good !! scared the shit out of me had my speakers up full too lol
×
×
  • Create New...