SQL Error on website Web 

Junior Spellweaver
Joined
Jul 10, 2015
Messages
119
Reaction score
3
So I can login, and register fine but when I enter my username and password before it loads the page it's directed to it shows a SQL error then it directs me to the login page but it logs in fine.. Also This is what I see in rankings:

Can someone please help me? I don't understand these errors :/
 
I think you're going to find that people in general are more willing to help if you show any initiative to solve the issue on your own (this applies to real life as well). I'm assuming you know English, or you have resources to look up the meaning of English words.
So let's break this error down.

"Fatal error" - Fatal, meaning that the code has "died" at this spot because it cannot recover from the error.
"Call to undefined function sql_injectionproof()" - "Undefined," meaning that the function "sql_injectionproof()" has not been declared anywhere.
"In C:\wamp\www\public\rankings.php on line 22" - The error is clearly telling you what the issue is, and where you can find it. So the logical thing to do would be to go to C:\wamp\www\public\rankings.php and check line 22 out. From the things explained above, you should deduce that there is something related to the function sql_injectionproof() that is going wrong. (Hint: you'll either have to define the function or remove the function call).

Don't freak out when you see an error. Most software will tell you what's going wrong. Do some investigative work, and do some thinking before you come running to the forums. And lastly, programming is a valuable skill to have. It is apparent from this post that you have little to no experience in programming or logical skills. I'd highly recommend taking a beginner course on codecademy or similar websites.

Not so bad, was it?
 
Upvote 0
I think you're going to find that people in general are more willing to help if you show any initiative to solve the issue on your own (this applies to real life as well). I'm assuming you know English, or you have resources to look up the meaning of English words.
So let's break this error down.

"Fatal error" - Fatal, meaning that the code has "died" at this spot because it cannot recover from the error.
"Call to undefined function sql_injectionproof()" - "Undefined," meaning that the function "sql_injectionproof()" has not been declared anywhere.
"In C:\wamp\www\public\rankings.php on line 22" - The error is clearly telling you what the issue is, and where you can find it. So the logical thing to do would be to go to C:\wamp\www\public\rankings.php and check line 22 out. From the things explained above, you should deduce that there is something related to the function sql_injectionproof() that is going wrong. (Hint: you'll either have to define the function or remove the function call).

Don't freak out when you see an error. Most software will tell you what's going wrong. Do some investigative work, and do some thinking before you come running to the forums. And lastly, programming is a valuable skill to have. It is apparent from this post that you have little to no experience in programming or logical skills. I'd highly recommend taking a beginner course on codecademy or similar websites.

Not so bad, was it?

I've tried to solve it myself by removing the whole function itself or trying to edit it but looking at the file I don't understand a thing on there. Yes I could take some beginner course but I'm simply not interested in learning within that section since I'm only setting up a CMS... Isn't that what CMS's are for? Isn't that what MapleBit is for? For people who have little to no experience on making their own website and having errors like this, so that when you download MapleBit it's ready to be installed and used?

Errors like this are common. It's to do with your database and the code in the pertaining php file. They can be fixed , but I''m really not sure of the cause.

I'm not so sure of the cause either since I use the same database for other CMS's and it's worked fine.. I've never seen this praticular error before, I've seen other SQL errors and they were simple to solve but this one is just confusing the hell outta me. :/

Anyways thanks for helping both of you...

If anyone else could help me, tell me what my error is and how to fix it, it would be great. This is my rankings.php:
Code:
<?phpif (isset($_GET['start'])) {
    if ($_GET['start'] >= 0 && $_GET['start'] 


<= 90) {
        $start = sql_injectionproof($_GET['start']);
    } else {
    


    die("Input not allowed.");
    }
} else {
    $start = 0;
}
?


><br><center></center>
<table border="1" bordercolor="#ffffff" cellspacing ="0" 


cellpadding="0" align="center" 
style="border-collapse: collapse; text-align: 


center;">
    <tr>
        <th style="width: 98px;">Rank</th>
        


<th style="width: 218px;">Name</th>
        <th style="width: 


158px;">Level</th>
        <th style="width: 150px;">Reborns</th>
    </tr>
    


<?php
$i = $start;
$sql = $mysqli->query("SELECT characters.name , characters.job , 


characters.level, characters.reborns, characters.meso, characters.fame, 


accounts.loggedin FROM characters, accounts WHERE 


characters.accountid=accounts.id and characters.gm = 0 and accounts.banned = 0 


ORDER BY characters.reborn".sql_injectionproof($start).", 5") or die 


(mysql_error());
while ($outcome = $sql->fetch_array()) {
?>
    <tr 


style="height: 40px; font-size: 13px;">
        <td style="background: #<?php if 


($outcome['loggedin'] > 0) { echo ""; } else { echo ""; }?>;"><?php echo ++$i;?


></td>
        <td><?php echo $outcome['name'];?></td>
        <td><?php echo 


$outcome['level'];?></td>
        <td><?php echo $outcome['reborns'];?


></td>
    </tr>
<?php }
if ($start >= 0 && $start <= 80) {
    $nextstart = $start + 10;
    


if ($start >= 10) {
        $prevstart = $start - 10;
    } else {
        


$prevstart = 0;
    }
} else if ($start > 80 && $start <= 90) {
    $prevstart = 


$start - 10;
    $nextstart = 90;
} else {
    die("Error");
}
    ?>
    <center>
    


<a href="?page=rankings&start=<?php echo sql_injectionproof($prevstart);?>" 


class="button">Prev</a> | <a href="?page=rankings&start=<?php echo 


sql_injectionproof($nextstart);?>" class="button">Next</a>
    


</table></center>s DESC, characters.level DESC LIMIT

Thank you.



Also getting this error, (another never seen error)



Anyone know what is mysqli or PDO is? Is it because something is outdated or?
 
Upvote 0
This issue is so incredibly simple, but if you're so resistant to learning and thinking then I have no interest in helping you out. Sorry!

I don't see why you needed to post that if you're not willing to help, not everyone is skilled in every section. I can learn if people tell me what's wrong and what I can do to fix it, I don't need to take a whole course on something I'm not very interested in. There is a reason I'm posting this in the help forum, I don't understand what is your problem? If you want to act like a jerk then go ahead but I'm just seeking help because I couldn't simply couldn't find the issue and what to do to fix this error. I'm stupid within a lot of this stuff but I learn from my mistakes and I learn as I go, I can't bare to take a whole course on something I am simply not interested in. If you think I'm going to come begging for your help then you're wrong, so stop being that one guy that tells the noob he knows everything but isn't willing to help because he's a jerk. I'm not that desperate to be begging people for help. Please leave my thread if you're not going to help. Thank you.
 
Last edited:
Upvote 0
I don't see why you needed to post that if you're not willing to help, not everyone is skilled in every section. I can learn if people tell me what's wrong and what I can do to fix it, I don't need to take a whole course on something I'm not very interested in. There is a reason I'm posting this in the help forum, I don't understand what is your problem? If you want to act like a jerk then go ahead but I'm just seeking help because I couldn't simply couldn't find the issue and what to do to fix this error. I'm stupid within a lot of this stuff but I learn from my mistakes and I learn as I go, I can't bare to take a whole course on something I am simply not interested it. If you think I'm going to come begging for your help then you're wrong, so stop being that one guy that tells the noob he knows everything but isn't willing to help because he's a jerk. I'm not that desperate to be begging people for help. Please leave my thread if you're not going to help. Thank you.

Here's the thing, I broke down your error for you. Word by word. You still took no initiative after that, which means that you're just waiting for someone to come along and do everything for you. I'd be perfectly happy to help you if you put an ounce of effort into reading the errors and my post. I even told you what the issue was in my post and how to fix it, yet you haven't even attempted to do so! All I'm asking is that you give it a shot (not take a course in PHP), and if you think that's being a jerk then I truly cannot help you...
 
Upvote 0
Here's the thing, I broke down your error for you. Word by word. You still took no initiative after that, which means that you're just waiting for someone to come along and do everything for you. I'd be perfectly happy to help you if you put an ounce of effort into reading the errors and my post. I even told you what the issue was in my post and how to fix it, yet you haven't even attempted to do so! All I'm asking is that you give it a shot (not take a course in PHP), and if you think that's being a jerk then I truly cannot help you...

Of course I've tried what you broken down for me, but I simply didn't understand what the heck I was suppose to do to the code because I didn't understand what sqlinjection was and no I'm not waiting for someone to spoonfeed me the php file with the fix, like I said I'd be happy if someone told me what was wrong and what to do to fix it so I can learn as I go, someone that would explain it in noob language to me of course. I understand you cannot help me, so I'm fine with that, I understand there are people on this forum that don't want to help those people who literally don't have experience in any of this because some of us are "spoonfeeding" but for me... I just want to learn as I go, and I want people to tell me what's wrong. Thanks for your time.
 
Upvote 0
Okay , this usually is my last resort . But since you are insisting to hide the errors , (only if you want to ! ) , follow this guide.

Since you're using wampp , I had to download and experiment it myself and found the way.

First ,

Through Wamp tray icon, open file php.ini and find

Code:
error_reporting = E_ALL

and replace that with this

Code:
error_reporting = E_ALL & ~E_NOTICE

Then save the file. Restart wampp.


Reload your webpage and have fun.
 
Upvote 0
Okay , this usually is my last resort . But since you are insisting to hide the errors , (only if you want to ! ) , follow this guide.

Since you're using wampp , I had to download and experiment it myself and found the way.

First ,

Through Wamp tray icon, open file php.ini and find

Code:
error_reporting = E_ALL

and replace that with this

Code:
error_reporting = E_ALL & ~E_NOTICE

Then save the file. Restart wampp.


Reload your webpage and have fun.

Thank you for your help, I've tried this and errors are still being displayed, I also did restart my wamp ):
 
Upvote 0
Back