Jump to content

willhub

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

willhub's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm confused, so what am I missing now?
  2. <?php /* * To change this template, choose Tools | Templates * and open the template in the editor. */ $name = $_POST['name']; $sname = $_POST['sname']; $address = $_POST['address']; $number = $_POST['number']; mysql_connect("localhost", "", "") or die ('error: ' .mysql_error()); mysql_select_db ("bza410_test"); $query="INSERT INTO testTable (firstname, surname, address, phone)VALUES ('".$name."', '".$sname."', '".$address."', '".$number."')"; mysql_query($query) or die ('error updating database'); echo "database updated with: " .$name. " ".$sname." ".$address." ".$number ; ?> Still does not work and I have removed ID and NULL....
  3. Oh the database the ID field is empty.
  4. Hi. For a uni assignment I am turning my static prototype into a dynamic prototype and adding various features like templates, log in system and the ability to add/delete information stored on the database and view the information on the website. I have running into a problem though, I am having difficulties getting connected to the database, I don't know if this is something to do with the log in information though, below I have quoted the files. update.php (the script I use to connect to the database) after localhost I am aware password/username goes there, just removed them for obvious reasons. home.php When I fill in the form and then press submit it goes to "error updating database" from the script, so have I got the server information wrong? Thanks Will.
×
×
  • 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.