Going crazy again ...

From: Date: Tue, 01 May 2001 18:53:40 +0000
Subject: Going crazy again ...
Groups: php.general 
Request: Send a blank email to php-general+get-50991@lists.php.net to get a copy of this message
Going grey haired again. In this code only the first case is working (adding stuff to tables). The second and third are producing - Warning: Supplied argument is not a valid MySQL-Link resource in /chroot/htdocs/diarium/settings.php on line 31 (which is $query_res ..../ms) error: I've even copied and pasted the also clause which works from sendaction to recaction but I get the same result. Anyone sees what going on? I don't. And my deadline is tomorrow (or thursday). M. switch ($sendaction) { case "Lägg till": $query="INSERT INTO employees (login, name)"; $query .= "VALUES('$txtSend', '')"; $query_res =mysql_query($query, $mysql_link) or die('error: ' . mysql_error()); if ($also=="Rec"){ $query="INSERT INTO contacts (id, name)"; $query .= "VALUES('$txtSend', '')"; $query_res =mysql_query($query, $mysql_link) or die('error: ' . mysql_error()); } break; } switch ($recaction) { case "Lägg till": $query="INSERT INTO contacts (id, name)"; $query .= "VALUES('$txtRec', '')"; $query_res =mysql_query($query, $mysql_link) or die('error: ' . mysql_error()); break; } switch ($archaction) { case "Lägg till": $query="INSERT INTO archive (s_name, name) VALUES('$txtArch', '')"; $query_res =mysql_query($query, $mysql_link) or die('error: ' . mysql_error()); break; }

« previous php.general (#50991) next »