From: Matthew M. <ma...@tu...> - 2002-10-21 13:50:28
|
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 |