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... (https://vborg.vbsupport.ru/showthread.php?t=155102)

SCS_Rocket-Devi 08-13-2007 12:23 PM

Need help...
 
I want to select the post count from userid 1 i have tried to use this and its not working :(

Quote:

SELECT * FROM `user` FROM `posts` WHERE `userid` = 1 LIMIT 1
What am i doing wrong?

Thanks Dan

Dilmah 08-13-2007 12:42 PM

SELECT posts FROM `user`WHERE `userid`=1 LIMIT 1

SCS_Rocket-Devi 08-13-2007 12:48 PM

Thanks, its getting somewhere but when u put it in as PHP code it shows the value as 0 when it should be 88

Code:

$querya="SELECT posts FROM `user`WHERE `userid`=1 LIMIT 1";

Opserty 08-13-2007 12:50 PM

If your doing it via a plugin or custom vB page you can use:
PHP Code:

$userid 2;
$userinfo fetch_userinfo($userid);
$postcount $userinfo['posts']; 

Otherwise I think its something like this:
PHP Code:

$query mysql_query("SELECT `posts` FROM `user`WHERE `userid`=1 LIMIT 1");
$array mysql_fetch_assoc($query);
$postcount $array['posts']; 


SCS_Rocket-Devi 08-13-2007 12:53 PM

im doing it from 3rd party script

Opserty 08-13-2007 12:55 PM

Use the second block of code I posted then, that should work.

SCS_Rocket-Devi 08-13-2007 01:22 PM

yey! thanks it works!


All times are GMT. The time now is 04:30 AM.

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.02207 seconds
  • Memory Usage 1,722KB
  • 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
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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