vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Need help with an SQL Query (https://vborg.vbsupport.ru/showthread.php?t=217234)

SnapOff Racing 06-27-2009 03:15 AM

Need help with an SQL Query
 
I need a query that I can execute so that I can turn "SHOW SIGNATURES" on for a certain user. You know how when you make a post and you have the option to "Show your Signature". Well if a user never created a signature from the day he signed up and then all the sudden creates one, that signature will not show up for all his past posts but only his future ones. So I need to create a query so that I can SELECT all the posts made from a certain user from the POST table and then execute another query to change the "showsignature" field from 0 to 1

EXAMPLE:
If I execute this query UPDATE post SET showsignature = 1 it will enable show signatures on every user that has made a post. So I was thinking that I need to run another query before that but I am having some trouble with the syntax. Here's what I got so far...

SELECT BillGates FROM `myforum`.`post`.`username`

But that syntax is obviously incorrect. So if any help would be appreciated :up:

vbplusme 06-27-2009 04:24 AM

This will update every post that BillGates has done where the signature is missing.


Code:

UPDATE `myforum`.`post` SET `showsignature` = '1' WHERE `post`.`username` ='BillGates' AND `showsignature`= '0'

HTH

SnapOff Racing 06-27-2009 07:08 AM

And that Michael is why YOU'RE THE MAN :D

Thanks worked PERFECT! :up:


All times are GMT. The time now is 06:59 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00919 seconds
  • Memory Usage 1,708KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete