I don't see 'caldata.resource' anywhere in the statement you posted.  Are
you sure you are sending the correct string to MySQL for execution as you
didn't post what MySQL tried to execute (based on its error message) for us
to look at. This may be a "variable name typo" issue.

One very simple technique you can use to debug many SQL issues like these
is to add to your code commands to write your SQL statements into your
output  just before you execute them. (I have found *SO* many finger flubs,
missing spaces, and data type mismatches that way!!) If you wrap your
debugging echo commands with conditional statements you will be able to
turn them on and off with great ease by just adjusting a single variable at
the top of your code. This is just a good practice to get into while
developing new applications. You could strategically strip them out again
later when you take your code into production or you can (I think "should")
leave them in for the rare cases when you need that information again.

Yours,
Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine



                                                                                       
                                
                      Jeff Blasius                                                     
                                
                      <[EMAIL PROTECTED]        To:       "'[EMAIL PROTECTED]'" 
<[EMAIL PROTECTED]>             
                      rs.com>                  cc:                                     
                                
                                               Fax to:                                 
                                
                      07/13/2004 05:45         Subject:  Error 1146                    
                                
                      PM                                                               
                                
                                                                                       
                                
                                                                                       
                                




I am trying to do an INSERT ... SELECT statement. When using MySQLcc
everything is fine. However when I try to execute the command using PHP I
get error 1146: Table 'caldata.resource' doesn't exist. Following is my
query statement. I am trying to combine a bunch of tables together and I
don't think the MERGE method will work very well for me. The table 'job'
already exists with all of the necessary fields. There is a primary key
setup in 'job' called 'id'. I appreciate any help.

INSERT INTO job (CustomerName, ModelNumber, SerialNumber,
CertificateNumber,
AverageFluidViscosity, JobNumber, SystemID) SELECT CustomerName,
ModelNumber, SerialNumber, CertificateNumber, AverageFluidViscosity,
JobNumber, SystemID FROM 50041_job

Jeff Blasius
 <mailto:[EMAIL PROTECTED]> mailto:[EMAIL PROTECTED]







-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to