NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page mySQL insert problems

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
2 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 08-20-2005, 09:59 AM THREAD STARTER               #1 (permalink)
NamePros Regular
Join Date: Mar 2005
Posts: 442
paaaaaaaaaa is a jewel in the roughpaaaaaaaaaa is a jewel in the roughpaaaaaaaaaa is a jewel in the rough
 



mySQL insert problems


Im having some problems with mySQL,

Ive been trying to INSERT a new record I know you have to do it like:
PHP Code:
INSERT INTO artists (idnamedatelocation)
????: NamePros.com http://www.namepros.com/programming/117092-mysql-insert-problems.html
VALUES ('''$name''$date''$location'
This is the code im useing but an example, it normally works for me but not this time. So to do some debugging I made phpmyadmin pump out some php for an insert and it adds in two extra values like:
PHP Code:
INSERT INTO artists (idnamedatelocation)
VALUES ('''$name''$date''',''NULL
This works but when I tell the last value to be a variable the extra values move about so I just cant get it right. Anybody know whats going on here?
__________________
Please add to my rep points if i was helpful. Thanks.

Content management system and online shop software
Last edited by paaaaaaaaaa; 08-20-2005 at 10:29 AM.
paaaaaaaaaa is offline  
Old 08-20-2005, 11:13 AM   #2 (permalink)
DNOA Member
Join Date: May 2004
Posts: 5,040
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
 


Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
if id is primary key, auto-increment, change '' to NULL.
mholt is offline  
Old 08-20-2005, 01:32 PM   #3 (permalink)
Domains my Dominion
 
sdsinc's Avatar
Join Date: Aug 2005
Location: Web 1.0
Posts: 9,963
sdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatness
 


Third World Education Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Animal Rescue Animal Cruelty AIDS/HIV Animal Rescue Wildlife Breast Cancer Animal Rescue Wildlife
If ID is primary key, auto-increment, there is not need to supply a value for that field...
sdsinc is online now  
Old 08-20-2005, 06:33 PM   #4 (permalink)
Pro Coder & Designer
 
aween's Avatar
Join Date: Apr 2005
Location: Netherlands
Posts: 967
aween is just really niceaween is just really niceaween is just really niceaween is just really niceaween is just really niceaween is just really niceaween is just really niceaween is just really nice
 



Originally Posted by sdsinc
If ID is primary key, auto-increment, there is not need to supply a value for that field...
You took my words!
__________________
aween web development
aween is offline  
Old 08-20-2005, 07:15 PM   #5 (permalink)
NamePros Regular
 
Jamison54's Avatar
Join Date: Jan 2005
Location: Milwaukee, WI
Posts: 305
Jamison54 will become famous soon enoughJamison54 will become famous soon enough
 



This should be the correct, and working code:
Code:
INSERT INTO `artists` (id, name, date, location) VALUES ('','$name','$date','$location');
paaaaaaaaaa, where you been?
Jamison54 is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial: How to Install Apache2 MySQL and PHP on Windows deadserious Webmaster Tutorials 35 09-21-2005 09:46 PM
HOW TO: Use shell to control MySQL. abdulmueid Webmaster Tutorials 16 08-27-2005 08:17 AM
Tutorial: Getting Started With MySQL (The Basics) deadserious Webmaster Tutorials 3 04-18-2004 01:17 PM
cannot find script sickle Web Design Discussion 5 04-03-2004 06:36 PM

 
All times are GMT -7. The time now is 12:12 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger