Webdetector Webmaster Forums - Your favorite webmaster community
 

Advertise Here Wordpress Premium Sportscrazyforum - Where Sport is a religion dnfame.com Spruce Host chooseapixel.com

Go Back   Webdetector Webmaster Forums - Your favorite webmaster community > Developers Corner > Programming > PHP Forum

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-21-2008, 01:24 AM
Junior Member
 
Join Date: Jul 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default i am using php with mysql and i am gettin these errors below?

Notice: Undefined index: teamname inc:\apache\cgi-bin\register.php on line 13

here is the code

Code:
#!c:/php/php.exe

<?php
$con = mysql_connect("localhost","student1","student1pw");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_select_db("uuj challange", $con);

$sql="INSERT INTO team (teamname, username, password, licencenum, surname, forename, contactnum, email, dateofbirth, housenum, streetname, city, county, postcode)
VALUES ('$_POST[teamname]','$_POST[username]','$_POST[password]','$_POST[licencenum]','$_POST[surname]','$_POST[forename]','$_POST[contactnum]','$_POST[email]','$_POST[dateofbirth]','$_POST[housenum]','$_POST[streetname]','$_POST[city]','$_POST[county]','$_POST[postcode]')";

if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "You Have Successfully registered.";
echo "<p>";
echo "<a href=\"http://localhost/menu.html\"> Click here</a> to return to the main menu.";

mysql_close($con)
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored links
  #2 (permalink)  
Old 07-21-2008, 02:00 AM
Junior Member
 
Join Date: Jul 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default i am using php with mysql and i am gettin these errors below?

Got a teamname column in the database?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-21-2008, 02:36 AM
Junior Member
 
Join Date: Jul 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default i am using php with mysql and i am gettin these errors below?

Also tables are supposed to have plural names.

check if the table name is teams, not team.

INSERT INTO teams (teamname, username ...

I am guessing this because it failed on the FIRST field you entered.

cowboyCoder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored links
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT +1. The time now is 12:19 AM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Ad Management by RedTyger