When using bindParam or bindValue you only want to use execute() and not execute(array(....));
When using bindParam or bindValue you only want to use execute() and not execute(array(....));
I've tried that as well as a number of other things while Googling around for some information. Nothing seems to be working yet though.
Here's what my messy code looks like now: [PHP] <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="author - Pastebin.com
Try changing your CALL query to this:
I have no servers on my computer anymore so I'm unable to test it myself. Btw, your create_account seems to be giving SQL syntax errors when I tried to run it.$stmt = $db->prepare('CALL create_account(?, ?)');
$stmt->bindParam(1, $accUsername, PDO::PARAM_STR|PDO::PARAM_INPUT_OUTPUT, 12);
$stmt->bindParam(2, $accPassword, PDO::PARAM_STR|PDO::PARAM_INPUT_OUTPUT, 32);
$stmt->execute();
Edit: See if you get any error messages with:
try {
// all your PDO stuff here
} catch (PDOException $e) {
echo $e->getMessage();
echo $e->getCode();
}
Last edited by InternetExplorer; 05-18-2014 at 10:25 AM.
I wasn't able to get any errors to show up, but I did remember that the nginx error.log file had some information that I used to bug-test when originally writing the code in the tutorial. Here is what's in that file 2014/05/19 05:37:24 [error] 2237#0: *1082 client intended to send too large body - Pastebin.com , there's definitely something going on with the config.inc.php file.
Cannot redeclare class MySQL is because you required the file more than once. You just need to require it once at the top of your page.
You can use require_once(); to prevent this, but it's slower than just using require();
"Client intended to send too large body" you can fix by increasing
to something like 100M. (nginx config)client_max_body_size
large_client_header_buffer
upload_max_filesize
post_max_size
Just debug every query, and you'll eventually find what's causing the issue.
Edit: Just in case, you may have to use error_reporting(E_ALL); on top of your page to see error messages if you haven't already.
Last edited by InternetExplorer; 05-19-2014 at 04:39 PM.
Thanks yet again. I definitely wouldn't have been able to get everything fixed up without your help.
After checking out some information on the body, buffer, and other settings I changed them to some somewhat reasonable numbers and the 'too large' error disappeared. Then I added a small <?php ?> section at the top of the HTML document and then the other error went away. Everything looks to be working as intended as far as my tests have shown and I'll now be rewriting the tutorial somewhat to show the new code. Thanks again!