Me again...

From: Date: Mon, 24 Feb 2003 11:48:12 +0000
Subject: Me again...
Groups: php.general 
Request: Send a blank email to php-general+get-136882@lists.php.net to get a copy of this message
Hi, please see the following red code... it adds info to a MySQL Table called "Schools". Whats the problem? Although the first time you execute it, it works, after the first time you send the form you get ERROR. $qs = 'INSERT INTO Schools (LongName, Abbreviation) VALUES (' . "'" . addslashes(trim($longname)) . "'," . "'" . addslashes(trim($abbrev)) . "')"; if(!mysql_query($qs, $db)) echo '<font color="red"><b>Error</b></font><br />'; And this is the CODE of the "Schools" Table CREATE TABLE Schools ( SchoolID int(10) unsigned DEFAULT '0' NOT NULL auto_increment, ShortName varchar(15) DEFAULT '' NOT NULL, LongName varchar(60), Abbreviation varchar(10), Approved tinyint(1) unsigned DEFAULT '0' NOT NULL, PRIMARY KEY (SchoolID), KEY Approved (Approved), KEY ShortName (ShortName), UNIQUE ShortName_2 (ShortName) ); It seems that the problem resides in ShortName.... but I still don´t understand what to do... Thanks a lot!!!!!!! Francisco _________________________________________ Francisco Mosse - fmosse@alipso.com - Webmaster de http://www.alipso.com - Centro de Capacitación DELFOS (http://www.delfosweb.com.ar). 4821-3353 / 4823-9334 - http://www.TangoStore.com 4371-7500 _________________________________________

« previous php.general (#136882) next »