MySQL Prob
Its 4 am here and im proly making some stupid mistake.
I have a table thats setup like this steamid | balance | income here is my code. It is not getting the income data. Always shows 0 when its set to 4. Code:
|
Code:
SELECT balance FROM money WHERE steamid='%s'" << you are only selecting balance. So you only get one field. You can do like this: Code:
If you wanted to get the income field also (which I think you really wanted to do?), you would have to change the select query to something like this: Code:
I hope you get the picture, you can only get the fields which you select. and they come in the order, 1, 2 and so on... defining constants right after the select has helped me keep the fields in order nice and straight. Might wanna take a look at syntax for SELECT: http://dev.mysql.com/doc/mysql/en/SELECT.html |
Re: MySQL Prob
Just a note for 0.20 DBI will look like this (don't do this now, keep it in mind):
Code:
Relevant changes: You access fields by name, not by row mysql_query returns 0 on SUCCESS if it has NO RESULT mysql_query returns a RESULT HANDLE to access results or a NEGATIVE NUMBER for failure. You use a RESULT HANDLE to get result specific information - this will let up execute multiple queries in loops. You must free the result of any query. This makes it similar to PHP's method, but it breaks a lot of backward compatibility. |
tnx alot jghg and bail.
and i do noe mysql syntax is just i wrote that 4 in the morning and i was way tooooooooo tired to go on. |
| All times are GMT -4. The time now is 07:02. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.