<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1021867" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1021867</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-sql-updateselect#comment-1134788</link>
    <description> &lt;p&gt;Hi Mark,&lt;/p&gt;
&lt;p&gt;   I didn&#039;t get immediate results from that. For now, I&#039;m doing a couple of individual selects and storing the &#039;userID&#039; index for reference.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;TM&lt;br /&gt;
aka Phil&lt;br /&gt;
&lt;a href=&quot;http://www.electricmountain.com&quot; class=&quot;bb-url&quot;&gt;electricmountain.com&lt;/a&gt;&lt;/p&gt;
 </description>
     <pubDate>Sun, 20 Jul 2003 18:49:05 +0000</pubDate>
 <dc:creator>TonyMontana</dc:creator>
 <guid isPermaLink="false">comment 1134788 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-sql-updateselect#comment-1134672</link>
    <description> &lt;p&gt;After searching the manual just now, I&#039;m not sure what version of mysql this requires.  &lt;a href=&quot;http://www.mysql.com/doc/en/Variables.html&quot; class=&quot;bb-url&quot;&gt;6.1.4 User Variables&lt;/a&gt; talks about variable use, but does not mention what version of mysql this was implemented in.&lt;/p&gt;
&lt;p&gt;You may first want to try this:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;SELECT @uid:=userIndex FROM iUsers WHERE userID=&amp;#039;$uID&amp;#039;;&lt;br /&gt;UPDATE iBusinesses SET userIndex=@uid WHERE key=val;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Fri, 18 Jul 2003 09:54:44 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1134672 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-sql-updateselect#comment-1134671</link>
    <description> &lt;p&gt;Not to my knowledge.  But there may be a way around it. (mysql &amp;gt;= 4.0.11)&lt;/p&gt;
&lt;p&gt;I haven&#039;t tested this, or played with it one bit.  But while reading the mysql docs recently, I came accross transactional statments in &lt;a href=&quot;http://www.mysql.com/doc/en/COMMIT.html&quot; class=&quot;bb-url&quot;&gt;6.7.1 BEGIN/COMMIT/ROLLBACK Syntax&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;From what I learned in the manual and looking at your queries above, you may want to try this: (after backing up the db)&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;START TRANSACTION;&lt;br /&gt;SELECT @uid:=userIndex FROM iUsers WHERE userID=&amp;#039;$uID&amp;#039;;&lt;br /&gt;UPDATE iBusinesses SET userIndex=@uid WHERE key=val;&lt;br /&gt;COMMIT;&lt;/code&gt;&lt;/div&gt;&#039;You&#039;ll run this in one mysql_query() call.  What&#039;s suppose to happen is mysql will assign the variable @uid the value of the select statement, then run the update query replacing the variable @uid with the value.&lt;/p&gt;
&lt;p&gt;If you try this, let me know of any results.  I&#039;ve not had time to play with this (not found time to upgrade mysql), but I&#039;m dying to know how well it works.&lt;/p&gt;
 </description>
     <pubDate>Fri, 18 Jul 2003 09:51:09 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1134671 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
