No announcement yet.

MySQL Query Help

  • Filter
  • Time
  • Show
Clear All
new posts

  • MySQL Query Help

    I recently converted my site from UBB to vBulletin. For some reason, and it could be my mistake, the "homepage" field in the "user" table shows the following value "http://" for all users who were imported that didn't have a "homepage" set.

    I want to clear that value from the database and return it to a blank field for all users that show the values of "http://". But, many users do have a "homepage" set and it usually starts with a "http://". So, I want to write a query to go through the database and erase the value "http://" in the "homepage" field of the "user" table for all records where the value is exactly "http://" without touching the records that also include the value "http://". My fear is that I will write a query that will blank the homepage field in all records that *contain* "http://" or that will delete the "http://" from the beginning of the existing correct records. I only want to blank the "homepage" field of the users that have exactly "http://".

    If any MySQL query guru can suggest a proper query, I would appreciate it.


  • #2
    UPDATE user
    SET homepage = ''
    WHERE homepage = 'http://'

    would do it, it'll only erase fields that matches the http:// exactly

    [Edited by Mas*Mind on 06-19-2000 at 06:12 AM]


    • #3
      vB People Rock...

      Thanks, Mas*Mind!


      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.