Re: Going crazy again ...
| From: | Jimmy Lantz | Date: | Tue, 01 May 2001 19:13:57 +0000 |
| Subject: | Re: Going crazy again ... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-50992@lists.php.net to get a copy of this message | ||
Hej, jag hade nog inte använt åäö i case men det är bara en vana, kanske du kan använda en
dold
variabel via html-formuläret istället och använda den i case satsen?
Men det svarar ju inte på din fråga men lycka till.
/ iImmy
Martin Skjöldebrand wrote:
> 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;
> }
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net