The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
I have a funtions include file with $db->query_read in the functions but when the page is called I get
Fatal error: Call to a member function query_read() on a non-object in /home/madden/public_html/forum/league_functions/functions_inc.php on line 191 Code:
190: $sql="select t.team as teamname, s.*,((s.win+(s.tie/2))/(s.win+s.loss+s.tie)) as Percent from $table s INNER JOIN $table_2 t ON t.team=s.team WHERE s.week='".$week."' and s.year='".$year."' AND t.conf='".$conf."' AND t.division='".$div."' ORDER by Percent DESC";
191: $teamstanding=$db->query_read($sql) or die("<b>A fatal MySQL error occured</b>.\n<br />Query: " . $sql . "<br />\nError: (" . mysql_errno() . ") " . mysql_error());;
192: while($tresult=mysql_fetch_object($teamstanding)){
|
|
#2
|
||||
|
||||
|
add
PHP Code:
|
|
#3
|
|||
|
|||
|
Thank you!
|
|
#4
|
||||
|
||||
|
Or you could just use $vbulletin->db->
|
|
#5
|
|||
|
|||
|
Is one way better than the other?
|
|
#6
|
||||
|
||||
|
They reference to the same thing, it's just that $vbulletin-> doesn't require you to globalize $db, thus saving you a line of code
.
|
|
#7
|
|||
|
|||
|
Ah.. makes sense, thanks.
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|