Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 08-09-2016, 07:21 PM
keharris53 keharris53 is offline
 
Join Date: Jun 2007
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default MySql Ver 5.1.31 Syntax Error

Hello!

I'm getting the following error:
mysql_fetch_row(): supplied argument is not a valid MySQL result resource in [path]/pp-classifieds/inc_ads.php on line 69

Line 69 reads:
while ( list( $catugid, $ugnoview ) = mysql_fetch_row($resultb) )

Syntax checker states the problem is in this first line, and has something to do with the use of while. Anybody here familiar with this? Thanks!
Reply With Quote
  #2  
Old 08-09-2016, 07:29 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This error usually indicates that the result of the query is invalid. This can happen when the required database/table structure is incomplete/missing or the database connection could not be made.
Reply With Quote
  #3  
Old 08-09-2016, 08:02 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The error tells you the problem. $resultb is not a valid result resource.

In otherwords, whatever is supposed to create it [in the code before it] failed, so its likely null or false.
Reply With Quote
  #4  
Old 08-10-2016, 03:59 PM
keharris53 keharris53 is offline
 
Join Date: Jun 2007
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is the code snipit that is giving me a problem. I used a couple online mysql checkers on this and both indicated a problem in the red text line. The script was written for php3x and my server has 5.1.13. The error has to do with the use of "while", so I'm trying to apply the correct syntax, but really don't know what that would be. I've looked online and have seen similar issues with example fixes, but I'm not sure how to apply them or if they'd even work...

$ViewPerm = array();

while ( list( $catugid, $ugnoview ) = mysql_fetch_row($resultb) )
{
$noview=0;
$ViewPerm[$catugid] = 1;

$allnoview = explode( ",", $ugnoview );

foreach ($allnoview as $key)
{
if (in_array($key, $grouparr) )
{
$noview = 1;
}
}

if ( $noview == 0 )
{
$ViewPerm[$catugid]=0;
}
}
}

Any thoughts on this would be appreciated. For added info, this snipit comes from the inc_ads.php file in Photopost Classifieds v4.1. Thanks
Reply With Quote
  #5  
Old 08-10-2016, 04:33 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That doesnt help at all, there isnt anything wrong with the line.

As I said before, the problem is $resultb, which should be a valid mysql result set, but isnt, so as I mentioned, the problem is with whatever creates that $resultb in the preceeding code.

Most likely as Dave said, the mysql connection or query is failing, so no result set is being generated.
Reply With Quote
  #6  
Old 08-10-2016, 04:51 PM
keharris53 keharris53 is offline
 
Join Date: Jun 2007
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the reply Mike, and actually I'm looking into a possible problem with the db connection. The classifieds were actually working just fine except one issue I was having with one of 6 data subdirectories. I decided to uninstall. On reinstall, several php errors were generated and I fixed all except this file. The required file identified in the script is required by multiple php files and all the others work, so what you suggest does make sense to me. I will first resolve an issue with the db tables regarding this application, then return to tackle this one. I don't want you to think I blew off the above comments, I'm just trying to rule out other possibilities as I work through this. I appreciate the input. Thanks!

Now, anybody know of a good gallery app? I'm using photopost vbGallery but it has a few shortcomings. Thanks.
Reply With Quote
  #7  
Old 08-11-2016, 03:46 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Who is this Mike ?
Reply With Quote
Благодарность от:
MarkFL
  #8  
Old 08-12-2016, 01:45 PM
keharris53 keharris53 is offline
 
Join Date: Jun 2007
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My bad, I was in a forum on another site just before I came back here. Must be oldtimerz. This problem was resolved. Going through my error logs there were multiple errors in the classifieds. Looked like issues that resulted from a bad install of the app. Though the classifieds were functioning well enough to post ads, there were background issues. I dropped the tables, removed the directory and reinstalled. Played with the classifieds, fixed a couple errors viewed in the log then backed it up. Running without errors now. Based on the info received by you (Paul ) and Dave, I figured data was being called from a table(s) that may have been corrupted. The classifieds had been running well for a few years and the syntax was checked against the newer php ver. on my server. Anyway, thanks for the input!

Now, anybody know of a good gallery? Using photopost vbgallery and it has a few shortcomings.
Reply With Quote
Благодарность от:
MarkFL
Reply

Thread Tools
Display Modes

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 08:39 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04479 seconds
  • Memory Usage 2,228KB
  • Queries Executed 13 (?)
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)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (2)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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_postinfo_query
  • fetch_postinfo
  • 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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete