Re: mysql query update two table in one?
| From: | Christian Heinrich | Date: | Thu, 10 Mar 2005 16:59:08 +0000 |
| Subject: | Re: mysql query update two table in one? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-210450@lists.php.net to get a copy of this message | ||
Tyler Replogle schrieb:
Can you update two tables in one mysql query i've got these two queries $db->query("updateBest regards, Christiandbn_members_countersset views =(views +1) where id = '$this->id' "); $db->query("updatedbn_membersset lastaction = $conf->site_time, page = '$this->page' where id = '$this->id' "); and i was wonder if i could get them into one because there are right next two each other and i'm trying to lower my query count. Yes, you can do that. BUT you need mySQL > 4.0 for this! Use a JOIN. Have a look at: http://dev.mysql.com/doc/mysql/en/update.html
From: K Karthik <kkarthik@adventnet.com> To: php-general@lists.php.net Subject: [PHP] php-help Date: Thu, 10 Mar 2005 12:31:35 +0530 MIME-Version: 1.0 Received: from mc7-f40.hotmail.com ([65.54.253.47]) by IMC3-S26.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Mar 2005 22:59:41 -0800 Received: from lists.php.net ([216.92.131.4]) by mc7-f40.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Mar 2005 22:59:41 -0800 Received: from ([216.92.131.4:25901] helo=lists.php.net)by pb1.pair.com (ecelerity HEAD r(5124)) with SMTPid E8/F4-53294-F40FF224 for <dbnm@hotmail.com>; Thu, 10 Mar 2005 01:59:30 -0500 Received: (qmail 17042 invoked by uid 1010); 10 Mar 2005 06:58:09 -0000 Received: (qmail 17024 invoked by uid 1010); 10 Mar 2005 06:58:09 -0000 X-Message-Info: JGTYoYF78jFevGptXBXjGwKBSvHljkD+bF1qvT/FEkQ= Return-Path: <php-general-return-210416-dbnm=hotmail.com@lists.php.net> X-Host-Fingerprint: 216.92.131.4 lists.php.net Mailing-List: contact php-general-help@lists.php.net; run by ezmlm Precedence: bulk list-help: <mailto:php-general-help@lists.php.net> list-unsubscribe: <mailto:php-general-unsubscribe@lists.php.net> list-post: <mailto:php-general@lists.php.net> Delivered-To: mailing list php-general@lists.php.net Delivered-To: ezmlm-scan-php-general@lists.php.net Delivered-To: ezmlm-php-general@lists.php.net X-Host-Fingerprint: 203.193.155.110 alps.manageengine.org Linux 2.4/2.6 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913 X-Accept-Language: en-us, en X-OriginalArrivalTime: 10 Mar 2005 06:59:41.0597 (UTC) FILETIME=[BBA044D0:01C5253E] sir, i'll explain my problem.and if anyone could help me i'll be thankful. i am displaying a content read from a file into a text area of a form. when i make changes andretrieve back in the text area, i encounter a problem.. i.e., when i enter text="please enter" i have an outputas text= /" please enter/" thanks, kkarthik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php