vb.org Archive

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

DannyBoy8406 08-07-2003 05:50 AM

SQL help....
 
alright....i posted this somewhere else, but now i realize it should have gone in here.....sorry, I'm new at this and just learning my way around here.....

I installed the "Member Photo Gallery" hack and to post member's photos you have to run an SQL query:

INSERT INTO photogallery VALUES (xxx, 'full-photo-URL', 'thumb-photo-URL', '');


xxx is replaced by the user id of the member.....




what query would you run to change a member's picture or delete it from the table?

When I try to put in a different photo, this is what I get...

Code:

Database error in vBulletin Control Panel 2.2.9:

Invalid SQL: INSERT INTO photogallery VALUES (5, 'http://www.wb-devotions.com/avatar.php?userid=5&dateline=1060140488', 'http://www.wb-devotions.com/avatar.php?userid=5&dateline=1060140488', '');

mysql error: Duplicate entry '5' for key 1

mysql error number: 1062


ImportPassion 08-07-2003 10:40 AM

I don't know what that table looks like, but try

PHP Code:

INSERT INTO photogallery VALUES (NULL,5'http://www.wb-devotions.com/avatar.php?userid=5&dateline=1060140488''http://www.wb-devotions.com/avatar.php?userid=5&dateline=1060140488'''); 


Velocd 08-07-2003 11:20 PM

I would uninstall that hack and install mine, just being it is far more convienant. ;)

(no running queries each time if you want to add a photo)

https://vborg.vbsupport.ru/showthrea...threadid=49565

g-force2k2 08-08-2003 05:16 AM

i would suggest using Velocd's as well even though i haven't seen the code i can assure that its more proficient.

As for your sql error its because there's already a value for the 5th user.

in that case you have two options...

you can either update the query or you can deleted the column and then reinsert it...

i don't know the specifications but if you can give me the table layout i can help you with the queries.

but i would go with the third option and use Velocd's hack...

regards,
g-force2k2

DannyBoy8406 08-08-2003 06:05 AM

here's the query i ran to setup the table...

Code:

CREATE TABLE photogallery (
  userid int(10) unsigned NOT NULL default '0',
  photo_full varchar(100) NOT NULL default '',
  photo_thumb varchar(100) NOT NULL default '',
  comments mediumtext NOT NULL,
  PRIMARY KEY  (userid)
) TYPE=MyISAM;

thx for helping BTW..

g-force2k2 08-08-2003 06:30 AM

hey k thanks for the info give me a minute and i'll create a file for you to use in combination with the hack...

regards,

g-force2k2

g-force2k2 08-08-2003 06:57 AM

1 Attachment(s)
don't know if it will be a 100% efficient but i tested it on my localhost and no parse errors were returned...

as for its functionality let me know if i have to fix anything :)

upload file to admin folder and then call the file by

yourforumurl/admin/photoadmin.php

regards,
g-force2k2

DannyBoy8406 08-08-2003 06:44 PM

working like a dream! thanks alot man!!!!


All times are GMT. The time now is 10:04 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.00999 seconds
  • Memory Usage 1,727KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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