Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   TBDev (http://www.bvlist.com/forumdisplay.php?f=20)
-   -   My code Problem (http://www.bvlist.com/showthread.php?t=1224)

al_ltoticmat 20th October 2008 17:12

My code Problem
 
I fixed it.
I want to auto pm to users who get this transfer bonus.

but it occurs this.
SQL Error
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 ' 2008-10-21 17:02:56, 'You receive money from ticc Value K\n', 0)' at line 1


Code:

$msg = sqlesc("You receive money from ".$CURUSER['username']." value ".$money." K");
                                @mysql_query("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES(0, $receiver, ". get_date_time() .", $msg, 0)") or sqlerr(__FILE__, __LINE__);


djlee 20th October 2008 19:09

without seeing the entire code i cant help much but

go to your html output (i.e. view source in your browser)

and look for the hidden input



see what the value is .. it should be outputting the value of $user['id'] but from the error im guessing it is not .. either that or the code in userdetails uve added doesnt account for id being sent via post and is wanting the id var sent by GET .. as i said without seeing the mod you've installed as well as the code uve added i cant help


userid is 42 and value is 42.

This is my userdetail.php
al_ltoticmat 21st October 2008 07:17

1 Attachment(s)
value is correct.

Code:

  

djlee 21st October 2008 08:32

find
Code:


change to
Code:



al_ltoticmat 21st October 2008 08:39

oh thx you very much.

My page is running. Very thx you.
If I have another problems, can I ask you again?

djlee 21st October 2008 08:41

as long as u post in the forums and dont pm me .. u'll be waiting an extremely long time for replies via PM

al_ltoticmat 21st October 2008 08:42

if ($money > $user["seedbonus"])

I think this is wrong because I put the number just 1 it's say You don't have enough money but I have 13.4.

djlee 21st October 2008 08:48

replace the print statement that says u dont have enough money with
Code:

print("Money: ".$money."Allowed: ".$user['seedbonus']."");
see what it outputs

al_ltoticmat 21st October 2008 10:08

I see the errors.
Thank you

It should be
Code:

if ($money > $CURUSER["seedbonus"])
but
Code:

                        else
                        {
                                $receiver["seedbonus"] + $money;
                                $CURUSER['seedbonus'] - $money;
                        }

Users that I give didn't receive my money and I didn't lost my money.

djlee 21st October 2008 10:17

wheres the query that does it all

something like
Code:

@mysql_query("UPDATE users SET seedbonus = seedbonus + $money WHERE id=$receiver");
@mysql_query("UPDATE users SET seedbonus = seedbonus - $money WHERE id=".$CURUSER['id']);

After that you can remove the two lines in the else statement (the queries are off the top of my head you may need to correct them if they dont work)


All times are GMT +2. The time now is 22:26.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.