Jump to content

Field shorten in PhpMyAdmin


Go to solution Solved by PravinS,

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 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.