You are confusing the string function with the sql function.

Mike Tuller wrote:

Unless I am mistaken on REPLACE's use, I don't think that will work. The
example I have in the O'Reilly MySql book that I have shows this.

REPLACE(string, old, new)
Returns a string that has all occurances of the substring old replaced with
new(e.g., REPLACE('black jack', 'ack', 'oke') returns "bloke joke").

I will explain what I am wanting to do.

I have a database that stores information about computers, and the
identifier is the ethernet address. I have a script that pulls the data from
a text file, and I want it so that if the ethernet address does not exist,
then it will insert the information into all columns. os_version,
ip_address, etc. If the ethernet address is not present, then it will update
the information in the fields.

I think I have to do a SELECT * from hardware_assets where ethernet_address
= $ethernet_address and then if there is a match, that row is updated, if
there is no match, then the data is inserted into a new row.


Mike





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



Reply via email to