Jump to content

Field shorten in PhpMyAdmin


Mrkay

Recommended Posts

Hi and thanks in advance.

 

Apologies but I'm a newbie at this.

 

I've got a field in a MySql (Place_id) table called Pic. Most of the data in that field is in the form #1234 but some are in the format 1234. What I want to do is strip out the # part of the data in every record of that field in the table that contains it. Can anyone help me with the sql please.

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/283269-field-shorten-in-phpmyadmin/
Share on other sites

I get an error - this is what I did and the response.

 

Error

SQL query: b_help.png

SELECT * 
FROM `Pic` 
UPDATE Pic SET Place_id = REPLACE( Place_id, '#', '' ) LIMIT 0 ,
30

MySQL said: b_help.png

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPDATE Pic SET Place_id = REPLACE(Place_id, '#', '')
LIMIT 0, 30' at line 2 

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.