Go Back   vb.org Archive > vBulletin 5 Connect Discussion > vB5 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-02-2019, 12:05 PM
BulliM's Avatar
BulliM BulliM is offline
 
Join Date: Oct 2017
Location: Bremen/Germany
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Cannot understand why this not work

Can anyone explain, why this works:

PHP Code:
$info vB::getDbAssertor()->getRow('user', array("userid" => $row['userid']), false'username'); 
and this not:


PHP Code:
$info vB::getDbAssertor()->getRow('anothertableindatabase', array("userid" => $row['userid']), false'username'); 
nor:

PHP Code:
$info vB::getDbAssertor()->getRow('vBForum:anothertableindatabase', array("userid" => $row['userid']), false'username'); 
nor:

PHP Code:
$info vB::getDbAssertor()->getRow('realdatabasename:anothertableindatabase', array("userid" => $row['userid']), false'username'); 
Going crazy with vB5 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Reply With Quote
  #2  
Old 02-03-2019, 03:52 AM
noypiscripter's Avatar
noypiscripter noypiscripter is offline
 
Join Date: Jul 2013
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What table did you specify? Not all tables have a column named "userid".
Reply With Quote
  #3  
Old 02-03-2019, 06:40 AM
BulliM's Avatar
BulliM BulliM is offline
 
Join Date: Oct 2017
Location: Bremen/Germany
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by noypiscripter View Post
What table did you specify? Not all tables have a column named "userid".
My table has. userid is the primary key in an added table (same database!). Different is, the searched column wasn't username but user_name. Surely I used that, too. Still cannot understand, why this won't work.
Reply With Quote
  #4  
Old 02-03-2019, 05:10 PM
noypiscripter's Avatar
noypiscripter noypiscripter is offline
 
Join Date: Jul 2013
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What is the SQL error? You would get an email with the SQL error if you've added your email in the dbtechnicalemail (or something like that) in the core config.
Reply With Quote
  #5  
Old 02-03-2019, 05:40 PM
BulliM's Avatar
BulliM BulliM is offline
 
Join Date: Oct 2017
Location: Bremen/Germany
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by noypiscripter View Post
What is the SQL error? You would get an email with the SQL error if you've added your email in the dbtechnicalemail (or something like that) in the core config.
I get no email, because development server has no access to email services.

I get "That action could not be completed. Please try again, and if this occurs again please contact the system administrator and tell them how you got this message. "

This works:

PHP Code:
<?php
global $vbulletin;
$pageuser // Row exists
$result $vbulletin->db->query_read('SELECT * FROM database.tablename WHERE userid ='.$pageuser);
$row $vbulletin->db->fetch_array($result);
Reply With Quote
  #6  
Old 02-03-2019, 08:03 PM
noypiscripter's Avatar
noypiscripter noypiscripter is offline
 
Join Date: Jul 2013
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Enable debug mode in the root config and core config to see the error stack trace.
Reply With Quote
  #7  
Old 02-03-2019, 08:10 PM
BulliM's Avatar
BulliM BulliM is offline
 
Join Date: Oct 2017
Location: Bremen/Germany
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by noypiscripter View Post
Enable debug mode in the root config and core config to see the error stack trace.
Result:

HTML Code:
Debug: Error
<b>API Error</b><br><b>Error:</b> invalid_query_definition_x<br><b>Args:</b><br><pre style="font-family:Lucida Console,Monaco5,monospace;font-size:small;overflow:auto;border:1px solid #CCC;">array ( 0 =&gt; 'tablename', )</pre>
occurred in file /var/www/xxxxxxx.xx/core/vb/db/query.php on line 298
Trace

    Function getQuery in file /var/www/xxxxxx.xx/core/vb/db/assertor.php line 225
--------------- Added [DATE]1549284087[/DATE] at [TIME]1549284087[/TIME] ---------------

I know now, why this not work. User delicjous helps me to found out. My table was not defined in querydefs.php. Since it is defined in, I get no errors anymore by using function getDbAssertor().

How should anyone know this?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:18 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.03883 seconds
  • Memory Usage 2,233KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_html
  • (5)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete