Very Annoying MySQL Problem...
#1

So, by the title you already know that I have a problem with MySQL (Using BlueG's include/plugin).

So bassicly I've decided to start learning MySQL with pawno and I can not get the stuff to save,
work correctly, and load..

I've attempted to create a registration system which is very simple but due to me being new to this..
It wasn't.

So, bassicly here's the pastebin now if someone could help me tell me where the problem occurs how to fix it
how to save data, how to load data, etc.

That'd be great!

I'd also like to mention that I'm not a beginner, therefore I've created several loading/saving system using
a different library which isn't mysql, so I'm bassicly trying to progress and use the best programms out there
in order to achieve a better goal that people can actually use and download later on.

Again, thanks to the people who would help me!
Reply
#2

check your mysql_log (it is in your server root) and see if you get any errors there.

What is 'the stuff' that is not being saved?

Also: it looks like you are using an old version of the plugin, is that right?
Reply
#3

Quote:
Originally Posted by mamorunl
Посмотреть сообщение
check your mysql_log (it is in your server root) and see if you get any errors there.

What is 'the stuff' that is not being saved?

Also: it looks like you are using an old version of the plugin, is that right?
I'm using R6 if I'm correct.
And the stuff that are supposed to save are the password and the name that's it.

Then I use strcmp to compare the pass and the name but nothing works.. IDK...

And how do I use that mysql_log thing? do I need to write something in the code in order to make that log appear?

EDIT found the log here it is: I believe I did if(mysql_num_rows() != 0) means its gonna ask for login.
Maybe I had to do "if(mysql_num_rows() > 0)" then it's gonna ask for login,Anyways I'm not sure if it was supposed to do this, to do. here's the LAST log of yesterday, hope you can help me:


pawn Код:
[07:17:34] >> mysql_query( Connection handle: 1 )

[07:17:34] CMySQLHandler::Query(SELECT * FROM 'accounts' WHERE 'Name' = 'opsafposakfpoa') - An error has occured. (Error ID: 1064, 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 ''accounts' WHERE 'Name' = 'opsafposakfpoa'' at line 1)

[07:17:34] >> mysql_store_result( Connection handle: 1 )

[07:17:34] CMySQLHandler::StoreResult() - No data to store.

[07:17:34] >> mysql_num_rows( Connection handle: 1 )

[07:17:34] CMySQLHandler::NumRows() - You cannot call this function now. (Reason: Dead Connection)

[07:17:37] >> mysql_real_escape_string( Connection handle: 1 )

[07:17:37] CMySQLHandler::EscapeString(54); - Escaped 2 characters to 54.

[07:17:37] >> mysql_query( Connection handle: 1 )

[07:17:37] CMySQLHandler::Query(SELECT * FROM 'accounts' WHERE 'Name' = 'opsafposakfpoa' AND 'Password' = '54') - An error has occured. (Error ID: 1064, 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 ''accounts' WHERE 'Name' = 'opsafposakfpoa' AND 'Password' = '54'' at line 1)

[07:17:37] >> mysql_store_result( Connection handle: 1 )

[07:17:37] CMySQLHandler::StoreResult() - No data to store.

[07:17:37] >> mysql_query( Connection handle: 1 )

[07:17:37] CMySQLHandler::Query(SELECT * FROM 'accounts' WHERE 'Name' = 'opsafposakfpoa') - An error has occured. (Error ID: 1064, 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 ''accounts' WHERE 'Name' = 'opsafposakfpoa'' at line 1)

[07:17:37] >> mysql_store_result( Connection handle: 1 )

[07:17:37] CMySQLHandler::StoreResult() - No data to store.

[07:17:37] >> mysql_fetch_row_format( Connection handle: 1 )

[07:17:37] CMySQLHandler::FetchRow() - You cannot call this function now. (Reason: Empty Result)

[07:17:37] >> mysql_free_result( Connection handle: 1 )

[07:17:37] CMySQLHandler::FreeResult() - The result is already empty.

[07:26:48] >> mysql_close( Connection handle: 1 )

[07:26:48] CMySQLHandler::~CMySQLHandler() - deconstructor called.

[07:26:48] CMySQLHandler::FreeResult() - The result is already empty.

[07:26:48] CMySQLHandler::Disconnect() - Connection was closed.
Reply
#4

It logs everything that the mysql plugin is doing. Also, print the values into your server log so that it has data.

Then: check your records if you have data (either command line mysql or through something like phpmyadmin or adminer)
Reply
#5

Quote:
Originally Posted by mamorunl
Посмотреть сообщение
It logs everything that the mysql plugin is doing. Also, print the values into your server log so that it has data.

Then: check your records if you have data (either command line mysql or through something like phpmyadmin or adminer)
It tells me I have an SQL error in the syntax, can you please tell me how to fix it and explain what caused that?

Thanks, would be greatly appreaciated.


EDIT: BRO! I think I know what caused, due to the wrong syntax the result couldn't be saved therefore none of the stuff got saved! That's why it says no result stored, and on freeresult() it says that no result were freed due to no result even being stored!

So, I just need the syntax to work correctly in order to get this to work!
Reply
#6

Do you see those table names and field names? You have them surrounded with single quotes (these > ' '). While that is correct for string values (like your name or any other text), for table names and column names you have to use backticks (like these > ` `). The backtick key can be found above the tab key and to the left of the 1 key.

Replace those and I am sure it will work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)