MySQL Error (0) Help

Okay, so I have this imageboard software called "Kusaba X", but I'm having a few problems with it. I had to redeploy my server image a few months back, and I recently re-uploaded all the SQL files and directories. Well, while testing it out, everything worked except the ability to post images. It returns the error "Could not copy uploaded image." I put on debug mode and attempted to reload the HTML files, and it gave me this error:

(mysqli): SELECT COUNT(DISTINCT `ipmd5`) FROM `kusabaposts` WHERE `boardid` = 1 AND `IS_DELETED` = 0
Error (0):

And a lot of other things that start with (mysqli) and end with Error(0). I've tried replacing the mysqli with mysql, but the same error occurred. Any help on this?

I've made sure that my MySQL database and user were correct and all privileges were granted to the user on the database, btw.

9 Replies

@Zowayixx:

lot of other things that start with (mysqli) and end with Error(0)
Is MySQL running?

@Zowayixx:

re-uploaded all the SQL files and directories.
If you upload just the SQL files, then you need to be sure your using the same version of MySQL. Ideally you should be exporting/importing your databases.

Travis

*Yes, MySQL is indeed running. I believe I am using the same version of MySQL I was whenever they were working, as I don't really touch the MySQL side of the server, update-wise. Also, I made a database and uploaded the SQL file via the "source *.sql" command, as the sql file itself was too large to be imported manually.*

@Zowayixx:

Yes, MySQL is indeed running. I believe I am using the same version of MySQL I was whenever they were working, as I don't really touch the MySQL side of the server, update-wise. Also, I made a database and uploaded the SQL file via the "source *.sql" command, as the sql file itself was too large to be imported manually.
If you imported the .sql file you dumped from the other database, then it shouldn't make a difference on the version of SQL you are running. Hopefully someone else can give you some pointers.

Travis

Anyone have an answer to this? I still haven't figured it out. =/

Without knowing what "Error (0):" means, it's going to be all guesswork. All I can recommend is starting the mysql command line client with the same username/password/hostname/database settings as your application, then try a few queries to make sure they work. If there's a way to get support for your application, they can probably troubleshoot more precisely.

You're probably better off asking the people who write the software. If you're well versed in php, I'd suggest digging into the source and changing their error reporting.

I have a feeling Error(0) is specific to whatever app you have. I don't think it's being returned from the actual mysqli call. Error catching using mysqli either returns (depending which function you use) an error code or a string containing the error message. Now obviously it's not returning the results of mysqli->error (which should return a message). It's also not the mysqli->errno function, since that returns 0 if there is NO error.

I suspect the app is doing some other check/validation and that section of the code outputs the last sql query with an uninformative error code.

what happens if you try running the sql statement given manually via phpmyadmin or another cli tool?

EDIT: Nevermind guys, I fixed it. It was due to a problem on my end. I did chown on a specific directory, but chown'ing the entire directory fixed it. Thanks for the help though. :D

It's generally considered bad form to continuously post in bold text or all caps. Some people may be put off by this, and may not offer assistance with the problem at hand.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct