Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Linux, Apache, MySQL > MySQL Help

MySQL Help Post any question relating to MySQL here and hopefully someone can help

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2006-09-11, 05:30 PM
Junior Member
 
Join Date: Sep 2006
Posts: 2
carmelomcc is on a distinguished road
Default Query update

i amt rying to subtract what is in an temporary table/column from a regular table/column, then i want to insert that data into another column in the table.

temporary table name = xxx
temporary column name = used_size

Normal table name = chk_info

Table column = used_size

Table column to drop the data into = daily_chg


Code sample:

update chk_info set daily_chg =(xxx.used_size-chk_info.used_size);

Last edited by carmelomcc; 2006-09-11 at 05:43 PM.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 2006-09-13, 11:30 AM
Moderator
 
Join Date: May 2004
Location: Portugal
Posts: 143
gesf is an unknown quantity at this point
Send a message via ICQ to gesf Send a message via MSN to gesf Send a message via Skype™ to gesf
Default

Have you tried running that in MySQL ? Do you receive any error messages at all?
If you're using this with php make sure you're not using the same variable for mysql_query.
You should use another one or unset it before re-initializing it with a different value.

Or perhaps it is a key field matter!
__________________
Best Regards,
Gonçalo "GesF" Fontoura

Website : gesf.org
Reply With Quote
  #3 (permalink)  
Old 2006-09-13, 02:44 PM
Junior Member
 
Join Date: Sep 2006
Posts: 2
carmelomcc is on a distinguished road
Default

It does not work with in the msql client. I can get the code to work when it is within the same table with two columns it works great, but when i work within two tables it fails.
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.0 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.0 (a popular PHP IDE) and NuCoder 1.4 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:46 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.