Jump to content

[SOLVED] MySQL number Inserting


cheechm

Recommended Posts

Thanks but now this:

 

UPDATE customers SET `number` = '07894512345' AND address = 'London' AND email = '[email protected]' AND name = 'Nick' AND postcode = 'WE1 3SW' AND company = 'Design' WHERE cid = 4

 

It sets number as 1?

what!!

 

Number = varchar(40) latin1_swedish_ci

 

Thanks so far!

You don't want to use "AND" like that. If you are setting more than one column separate them with commas:

UPDATE customers SET `number` = '07894512345', address = 'London', email = '[email protected]', name = 'Nick', postcode = 'WE1 3SW' 

 

Ken

That's because you are setting to the result of a boolean expression with those ANDs. Correct syntax is

 

UPDATE customers SET

    `number` = '07894512345',

    address = 'London',

    email = '[email protected]',

    name = 'Nick',

    postcode = 'WE1 3SW',

    company = 'Design'

WHERE cid = 4

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.