Tyler Replogle schrieb:

Can you update two tables in one mysql query
i've got these two queries
$db->query("update `dbn_members_counters` set views =(views +1) where id = '$this->id' ");
$db->query("update `dbn_members` set 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

Best regards,
Christian

From: K Karthik <[EMAIL PROTECTED]>
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 <[EMAIL PROTECTED]>; 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: <[EMAIL PROTECTED]>
X-Host-Fingerprint: 216.92.131.4 lists.php.net Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
list-help: <mailto:[EMAIL PROTECTED]>
list-unsubscribe: <mailto:[EMAIL PROTECTED]>
list-post: <mailto:php-general@lists.php.net>
Delivered-To: mailing list php-general@lists.php.net
Delivered-To: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
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



-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to