Jump to content

Beginner question


aleniko

Recommended Posts

Hi all;

I have the following statement to create a temporary table:

 

mysql_query("create temporary table curdist1

  select acct,name,address1,address2,krccust.city,krccust.state,krccust.zip,krccust.tel,zips.lat,zips.lon,termtype,web,shpadrs1,shpadrs2,shpcity,shpstate,shpzip

                from krccust left join zips on left(krccust.zip,6)=zips.zip")  ;^M

 

After the table is created, I need to go through it and change every record which has the phrase "P.O." in the name field. I need to replace the information in the name,address1,address2,city,state,zip with the corresponding shpname,shpadrs1,shpadrs2,shpcity,shpstate,shpzip for all the records which have "P.O" in the name field.

Can someone let me know what's the syntax for that?

 

Also, I would like to know if this is achievable withing the original select statement.

 

Thanks!

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/268430-beginner-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.