SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot jammo's Avatar
    Join Date
    Dec 2003
    Location
    el paso tx
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    need to update DB table row, HOW?

    http://dev.mysql.com/doc/mysql/en/SELECT.html

    i spent a lot of time there this morning, but they have lots of cluttered syntax examples that i didnt understand.
    so i was hoping that you all could help me out here.


    im running Invision Board Forums v.1.3.1 Final on my site.
    as administrator, i set up my forum so that a new user needs to first accumulate 2 posts in the Newbie Lounge Forum first, to gain access to the rest of the forums.

    upon registration, they are Newbie Members, with 0-1 posts.
    with 2+ posts, they become Members.

    there are a total of 898 members on my forum, myself included.
    of thos 898, only 6 have ticked the little box to receive any updates or email sent by the board administrator (me).

    483 of my registered members are Newbie Members. and i feel that they didnt understand that in order to use the forums, they need to post in the Newbie Lounge.

    i hope youre still with me so far.



    i need to sent an email to all those Newbie Members of my forum and let them know HOW to access the remainder of my forums.
    but they do NOT have the box ticked to receive my emails from my ACP.
    so i went into phpMyAdmin and saw that there are 3 variables, that dictate whether or not a member can receive an email from me.
    NULL => which i assume sets to 0?
    0 => which i know means NO, dont send me emails.
    1 => which i know means YES


    so, i dont know much mySQL, and i was stumped on my following query:
    Code:
    SELECT allow_admin_mails
    FROM iBB_members
    WHERE  =
    how do i change all the NULL & 0 values to 1?

    << i will make a backup my my _members DB before i make any changes, as i dont want to violate my members privacy, and ill set their option BACK to original status after sending out my email >>


    i feel this is a necessary step to encourage my members to visit my forum more often, cause 50% +/- dont post cause they have 0-1 posts.

  2. #2
    SitePoint Addict silent's Avatar
    Join Date
    Jun 2004
    Location
    Roaming North America
    Posts
    220
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jammo
    so, i dont know much mySQL, and i was stumped on my following query:
    Code:
    SELECT allow_admin_mails
    FROM iBB_members
    WHERE  =
    how do i change all the NULL & 0 values to 1?
    Well, since there are only 3 possible values for the column, and you want to change any row with 2 of the 3 values to the remaining value, you can issue an update to set ALL the rows to the remaining value:
    Code:
    UDPATE iBB_members SET allow_admin_mails = 1

  3. #3
    SitePoint Zealot jammo's Avatar
    Join Date
    Dec 2003
    Location
    el paso tx
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by silent
    Well, since there are only 3 possible values for the column, and you want to change any row with 2 of the 3 values to the remaining value, you can issue an update to set ALL the rows to the remaining value:
    Code:
    UDPATE iBB_members SET allow_admin_mails = 1

    MySQL said:
    #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 'UDPATE iBB_members SET allow_admin_mails =1' at line 1
    error

    ill figure this out.
    darn thing.

  4. #4
    SitePoint Zealot jammo's Avatar
    Join Date
    Dec 2003
    Location
    el paso tx
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by silent
    Code:
    UDPATE iBB_members SET allow_admin_mails = 1
    aw man.

    mispelling

    Code:
    UDPATE iBB_members SET allow_admin_mails = 1
    Code:
    UPDATE iBB_members SET allow_admin_mails = 1
    i feel like DUH! HUH?


    thanks for the help man.
    truly appreciate it.

  5. #5
    SitePoint Addict silent's Avatar
    Join Date
    Jun 2004
    Location
    Roaming North America
    Posts
    220
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no problem. It was my typo, right!? LOL

  6. #6
    SitePoint Zealot jammo's Avatar
    Join Date
    Dec 2003
    Location
    el paso tx
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by silent
    no problem. It was my typo, right!? LOL
    uh, i think so bubba.

    anyhoo, it worked like a charm.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •