Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-14-2004, 10:09 PM
Warlord's Avatar
Warlord Warlord is offline
 
Join Date: Jan 2002
Location: TN, USA
Posts: 668
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Finding the right variable....

I've been reading my book "PHP, fast and easy web development" by Julie C. Meloni, and I'm learning quite a bit, and I've rewritten a script to do what I want, but with one small problem..

I think I've found a way to seperate my links being pulled from the database into categories based on what company they fall under, but I just need to find the correct variable for the company.

Right now, I'm using
PHP Code:
$myrow['company'
But unfortunately that doesn't seem to be the correct variable, so the statement shows up false every time.

I've attached the file I'm using, could someone please take a look at it and help me find the correct variable to use with my and operators. After I figure out the correct variable, I think my script should work great.

Any ideas?
Attached Files
File Type: txt editedscript.txt (6.0 KB, 10 views)
Reply With Quote
  #2  
Old 10-14-2004, 10:15 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm, actually it looks correct, but without knowing the db structure you cannot say for sure.

if nothing helps try to add

PHP Code:
print_r($myrow); 
Reply With Quote
  #3  
Old 10-14-2004, 10:23 PM
Warlord's Avatar
Warlord Warlord is offline
 
Join Date: Jan 2002
Location: TN, USA
Posts: 668
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That made this show up on the page....

Quote:
Array ( [0] => 7 [id] => 7 [1] => [company] => [2] => [name] => [3] => [realname] => [4] => [legalstatus] => [5] => [firstappearance] => [6] => [team] => [7] => [height] => [8] => [weight] => [9] => [hair] => [10] => [eyes] => [11] => [features] => [12] => [powers] => [13] => [weakness] => [14] => [history] => [15] => [image] => )
I'm assuming that shows the structure of the db? How do you read it?
Reply With Quote
  #4  
Old 10-14-2004, 10:47 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nope it doesn't show the structure, but the content of the variable $myrow.

and as you see, the key 'company' exists, therefore the code is correct, it's just nothing is entered in the db.

speak the id of the entrie is 7 but every other value is empty.
Reply With Quote
  #5  
Old 10-15-2004, 12:28 AM
Warlord's Avatar
Warlord Warlord is offline
 
Join Date: Jan 2002
Location: TN, USA
Posts: 668
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There's 20 entries in the db... here's a screen shot showing some of them. And I made sure it's pulling from the right table, that table is called cbd and that's what the code calls it from.
Attached Images
File Type: gif dbscreenie.gif (32.5 KB, 0 views)
Reply With Quote
  #6  
Old 10-15-2004, 12:33 AM
Warlord's Avatar
Warlord Warlord is offline
 
Join Date: Jan 2002
Location: TN, USA
Posts: 668
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm.. just deleted that blank row and now they're all showing up, but they're showing up under DC Comics instead of their perspective companies. Now I'm really confused....

http://www.neropolis.com/index.php?page=bios
Reply With Quote
  #7  
Old 10-15-2004, 08:39 PM
Warlord's Avatar
Warlord Warlord is offline
 
Join Date: Jan 2002
Location: TN, USA
Posts: 668
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nevermind, got it all figured out, thanks to you guys and some people over at vbadvanced.com and phpBuilder.com.

Many thanks for your help it was very informative and appreciated.

Next step for me: Try to figure out how to integrate it into vbulletin. .. but that can wait 'till after I get back from my vacation.
Reply With Quote
  #8  
Old 10-15-2004, 10:31 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you're welcome

enjoy your vacation
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 07:30 AM.


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.04325 seconds
  • Memory Usage 2,252KB
  • Queries Executed 12 (?)
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
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (2)postbit_attachment
  • (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_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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete