List:General Discussion« Previous MessageNext Message »
From:Mark Sargent Date:June 1 2006 9:12am
Subject:auto_increment Question
View as plain text  
Hi All,

if a table has an auto_incremented primary key why does the below code 
require the people_id to be manually inserted? I got this from Beginning 
PHP, Apache, MySQL Web Development book from Wrox. Curious, as it seems 
to defeat the purpose of auto_increment, no? Cheers.

$people = "INSERT INTO people (people_id, people_full_name, 
people_isactor, people_isdirector) VALUES (1, 'Jim Carey', 1, 0), (2, 
'Tom Shadyac', 0, 1), (3, 'Lawrence Kasdan', 0, 1), (4, 'Kevin Kline', 
1, 0), (5, 'Ron Livingston', 1, 0), (6, 'Mike Judge', 0, 1)";
$results = mysql_query($people) or die(mysql_error());

Mark Sargent

Thread
auto_increment QuestionMark Sargent1 Jun
  • Re: auto_increment QuestionDouglas Sims1 Jun
  • Re: auto_increment QuestionPaul DuBois1 Jun