3 Replies - 550 Views - Last Post: 28 February 2010 - 12:34 PM Rate Topic: -----

#1 m-e-g-a-z  Icon User is offline

  • Winning
  • member icon


Reputation: 496
  • View blog
  • Posts: 1,453
  • Joined: 19-October 09

printing out error message

Posted 28 February 2010 - 12:03 PM

Hi, i am quite new to php and ive created this php code below and i dont know what ive done wrong. It prints out the else statements error message stating no table created?

<?php
include_once"connect.php";
$result="CREATE TABLE myMembers (
id int(11) NOT NULL auto_increment,
firstname varchar(255) NOT NULL,
lastname varchar(255) NOT NULL,
address1 varchar(255) NOT NULL,
address2 varchar(255) NOT NULL,
county varchar(255) NOT NULL,
city varchar(255) NOT NULL,
postcode varchar(255) NOT NULL,
phone varchar(255) NOT NULL,
bio_body text NOT NULL,
website varchar(255) NULL,
youtube varchar(255) NULL,
email varchar(255) NOT NULL,
password varchar(255) NOT NULL,
sign_up_date date(255) NOT NULL default '0000-00-00',
last_log_date date(255) NOT NULL default '0000-00-00',
account_type enum ('a','b','c') DEFAULT 'a',
account_notes varchar(255) NOT NULL,
email_activated enum('0','1')NOT NULL DEFAULT '0',
PRIMARY KEY(id),
UNIQUE KEY email(email))";
if(mysql_query($result)){
echo"Sucess in table creation!...
<br/><br/><b>That completes table setup<br/>
gfdsgsdfgdg</b>";
}
else {

print "no table created";

}
exit();

?>



Edit: typo error

This post has been edited by m-e-g-a-z: 28 February 2010 - 12:04 PM


Is This A Good Question/Topic? 0
  • +

Replies To: printing out error message

#2 JackOfAllTrades  Icon User is online

  • Saucy!
  • member icon

Reputation: 5951
  • View blog
  • Posts: 23,209
  • Joined: 23-August 08

Re: printing out error message

Posted 28 February 2010 - 12:07 PM

See my post here
Was This Post Helpful? 0
  • +
  • -

#3 m-e-g-a-z  Icon User is offline

  • Winning
  • member icon


Reputation: 496
  • View blog
  • Posts: 1,453
  • Joined: 19-October 09

Re: printing out error message

Posted 28 February 2010 - 12:21 PM

I fixed the problem...setting the amount of characters (255) in the date. Removed it and its working.
Was This Post Helpful? 0
  • +
  • -

#4 JackOfAllTrades  Icon User is online

  • Saucy!
  • member icon

Reputation: 5951
  • View blog
  • Posts: 23,209
  • Joined: 23-August 08

Re: printing out error message

Posted 28 February 2010 - 12:34 PM

Excellent, but anyone reading this: please take the advice in the linked post to heart. If people did what was in that post from the get-go, half the questions on PHP forums would disappear. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1