[SOLVED]Stumped!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
radium35
Forum Commoner
Posts: 50
Joined: Mon Nov 10, 2008 5:05 pm
Location: USA
Contact:

[SOLVED]Stumped!

Post by radium35 »

using the exact same syntax to connect to mysql and it does not dump the data???@#$ WTF i checked every over 10 thousand times i dont even get php errors :banghead:

Code: Select all

<? $db = mysql_connect('localhost', 'user', 'pass');
    
mysql_select_db('mcp', $db) or die('Could not select database.');
    
mysql_query("INSERT INTO agreement (id,   first,   
									 last,                                    
									 addy, 
									 pp,
									 deadline, 
									 desc, 
									 menu_items, 
									 email, 
									 ip, 
									 date, 
									 agree_status
									 ) 
									 VALUES 
									 ('', 
									 'value',
									 'value',
									 'value',
									 'value',
									 'value', 
									 'value', 
									 'value',
									 'value',
									 'value',
									 'value', 
									 'value')");
                                     
									  mysql_close($db);




?>

Code: Select all

CREATE TABLE `agreement` (
  `id` int(10) NOT NULL auto_increment,
  `first` varchar(35) NOT NULL,
  `last` varchar(35) NOT NULL,
  `addy` varchar(45) NOT NULL,
  `pp` varchar(25) NOT NULL,
  `deadline` varchar(25) NOT NULL,
  `desc` longtext NOT NULL,
  `menu_items` varchar(100) NOT NULL,
  `email` varchar(35) NOT NULL,
  `ip` varchar(15) NOT NULL,
  `date` varchar(20) NOT NULL,
  `agree_status` varchar(5) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;
Last edited by radium35 on Sat Jun 26, 2010 3:34 pm, edited 2 times in total.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Stumped!

Post by requinix »

"desc" is a reserved word and "date" is a built-in function. If you want to use those names you need to quote them.

And you aren't getting any errors because you aren't asking for them.
User avatar
radium35
Forum Commoner
Posts: 50
Joined: Mon Nov 10, 2008 5:05 pm
Location: USA
Contact:

Re: Stumped!

Post by radium35 »

i should thanks in advance then do 'desc'
User avatar
radium35
Forum Commoner
Posts: 50
Joined: Mon Nov 10, 2008 5:05 pm
Location: USA
Contact:

Re: Stumped!

Post by radium35 »

Thanks! removed desc and all works great!!!!!!!!!!!!!1111 :D

tasairis wrote:"desc" is a reserved word and "date" is a built-in function. If you want to use those names you need to quote them.

And you aren't getting any errors because you aren't asking for them.
Post Reply