The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Help with a PHP file
I have created the following PHP file, and I cannot get the results to return corrrectly. The echo command is returning a value of 1. I have run the query manually from the PHP console, and it returns the correct value. I figure I made a dumb mistake or I am not connecting the DB correctly becuase if I manually add the value at the end of the http line it shows correctly. Here is my code for the query:
PHP Code:
|
#2
|
||||
|
||||
Do you just run this file by itself? If so, it's not going to work, as no vBulletin functions will be available there (as global.php is not included).
|
#3
|
|||
|
|||
OK I basically started over did all of the code from scratch, but now I have a new problem. I created the file and tested it by directly accessing the file via http://mysite/file.php. It ran perfect. Now I have pulled it in as a module, and after updating the directory to global.php to make it work I figured I would be fine. Now, however, it appears that my query is no longer pulling the value needed.
FYI...I am using CMPS as my index page which is where I am trying to create the module. The code is below. PHP Code:
|
#4
|
||||
|
||||
Where is the title coming from in this where statement:
PHP Code:
|
#5
|
|||
|
|||
Quote:
What do you mean defined? |
#6
|
||||
|
||||
Can you actually spit out that variable? If not, it isn't defined. By defined I mean that the code, somewhere, needs to say "style[title] = whatever' before you go and try to use it somewhere. If no code defines it prior to you trying to use it, then it isn't available for your use.
|
#7
|
|||
|
|||
Lynne,
I get what you are asking, and when I originally coded this page I forgot to add the value for "Default Style" into the table fbschedule so it wasn't returning anything. When I plugged in a dummy value it started working so I know that it a valid value in vB. I can even run the native PHP when I access it here: http://www.sportssoundoff.com/forums...s/schedule.php When I try to insert it as a module to display it on my front page it dies. FYI...when I originally thought about implementing this I wanted to use the AJAX GUI hack, and I know when I make a call to that page it displayed OK as well. Any other ideas? |
#8
|
|||
|
|||
PS A title can contain special charachters like ', and should be escaped before used in a query.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|