vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   New Row in VB3 DB (https://vborg.vbsupport.ru/showthread.php?t=61927)

Mike Cout 02-25-2004 10:53 PM

New Row in VB3 DB
 
Hello,
I am currently working on a hack in which the user has "points". I have written everything out involving the points on a seperate DB and have it working fine. Now I would like to insert a "point" row in for each of my current users and have it work for future users.

Could anyone help me with how I would do this?

-Mike

P.S. I do have phpmyadmin.

Andreas 02-25-2004 10:57 PM

[sql]
ALTER TABLE user ADD point INT NOT NULL
[/sql]

Mike Cout 02-25-2004 11:34 PM

Now I'm just having trouble selecting the points row.
PHP Code:

$query 'SELECT * FROM `dev_user`';
$result mysql_query($query);
echo 
mysql_result($result); 

What do I need to change to my query to read the value of points?

Thanks!
-Mike

AN-net 02-25-2004 11:40 PM

PHP Code:

mysql_select_db("vbulletin"); 


Andreas 02-25-2004 11:41 PM

Try
PHP Code:

$query 'SELECT point FROM dev_user';
$result mysql_query($query);
echo 
mysql_result($result); 


Mike Cout 02-25-2004 11:46 PM

Worked perfectly.

Best Regards,
-Mike

Mike Cout 02-28-2004 11:57 AM

Im having trouble writing to a specific user. Any idea on how I would write the points to the database by userid?

I've been trying to use LIMIT but have been unsuccessful.

Thanks,
-Mike

Andreas 02-28-2004 12:06 PM

[SQL]
UPDATE dev_user SET point=1234 WHERE userid=4321
[/SQL]

Of course the numbers must be replaced with the actual values ;)
If you just want to increase/decrase the points use SET point=point+value.

Mike Cout 02-28-2004 01:04 PM

Thank you!

Mike Cout 03-07-2004 03:48 PM

I'm having trouble getting the users point total to display in the postbit. Could you help me with this?

I was thinking I would add into showthread a way to query the DB using each post's information.

$query = 'SELECT dev_user FROM points WHERE username=post[musername]';

Im not very familar with the way VB does queries and am having trouble understanding it.

-Mike


All times are GMT. The time now is 11:11 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.01092 seconds
  • Memory Usage 1,733KB
  • 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
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete