From: Don S. <do...@se...> - 2002-10-21 13:56:43
|
Assuming your sqlInsert function uses nextId(), it looks fine. I have reservations about your naming of parameters as "maxColumn" and "returnMax". Perhaps naming them "idColumn" and "returnId" would be better. I realize it's just names and doesn't really matter but might as well mention it before it's written. Don. On Mon, 21 Oct 2002, Matthew McNaney wrote: > Ok I figured out what I did wrong. I did not set my test table as primary, > it were merely indexed. I thought all my id columns were primary. > Anyway... > > I got it to work. Thanks Don. I actually found your letters to php.net > through Google. Man that thing is fast :) > > As you said (and Bob's -1 explained) it appear to increment correctly. I > am naming the sequence by the table name as will be unique per table. > > I have written the sqlInsert in my copy but I need a definative parameter > list. Please vote on the final outcome. > > function sqlInsert ($db_array, $table_name, $maxColumn=NULL, > $check_dup=FALSE, $returnMax=FALSE, $show_sql=FALSE) > > db_array : associate array of columns=>values > > table_name : self explanatory > > maxColumn : the id column to increment > > check_dup : does not insert a row if a duplicate db_array is found (will > ignore the id for checking purposes) > > returnMax : returns the max id if TRUE. > > show_sql : shows the sql string for error checking. > > --------------------------------- > User example: > $this->user_id = $GLOBALS["core"]->sqlInsert($sql_array, "mod_users", > "user_id", 1); > > > I would like to get this voted on as I am anxious to update my code. > > Please post :) > > Thanks again, > Matthew McNaney > Internet Systems Architect > Electronic Student Services > Email: ma...@tu... > URL: http://phpwebsite.appstate.edu > Phone: 828-262-6493 > ICQ: 141057403 > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Phpwebsite-developers mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpwebsite-developers > |