Jump to content

Problem with my code?


Recommended Posts

Does anyone have any ideas why I get those errors:

Notice: Undefined variable: minlevel in /home/damdomy/trankia.com/modules/FindPlayer/index.php on line 94

Warning: array_fill() [function.array-fill]: Wrong data type for start key in /home/damdomy/trankia.com/lib/db.mysql.php on line 133

Error: DbException!

Query: SELECT username, level FROM players WHERE level > ?,50
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?,50' at line 3


Source code:

Link to comment
Share on other sites

Fanatic Try something along these lines...

When you declare the function start() add a parameter, for example $min_level


* Add a parameter
* Add a value, so when called, and no parameter is given it won't show ugly errors
* Default, minimum level 1.
public function start($min_level = 1) 


Now, Line 82.

* Use the parameter declared in the function declaration
* $min_level
$minlevel = $min_level;


! Use the above to help configure the rest of the php.

Now, when you call this function start(), add the parameter

* Assign the class, I assume that's been done. 
* I'll call it $class
$minlevel = $var; // assume  _GET['minlevel']
$class->start($minlevel); /* Declare a minimum level. Overwrite the default; 1. */


I think this should fix your error, it may not, but it might.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...