Ok this is not ASP. This is PHP but the code is almost the same. just one thing all vars are followed by $<BR>So please if anyone could help!<BR>----------------------------<BR>i am facing a weird and funny SQL problem,<BR>i have a "country" table in the mysql database "university", ok .This table has 2 fields "country_id" and "country_name"<BR>now when i want to add a new record i excute the following..<BR><BR>$result = mysql_db_query("university","select max(country_id)+1 from country");<BR><BR>so that i get the top of the table and then execute:<BR><BR>mysql_db_query("university","inser t into country (country_id,country_name) values($result,&#039$country&#039)"); <BR><BR>where $country is the variable i get from a form on the previous HTML page.<BR>Now to the funny part. $m turns out to be 2 when there are actually 5 records i.e $m should be 6!! . i swear on god there are actually 5 records when i look at it from the mysql prompt!<BR><BR>Please help<BR><BR>