|
#1
|
|||
|
|||
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__); Last edited by al_ltoticmat; 22nd October 2008 at 08:32. |
#2
|
||||
|
||||
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 <input type=hidden name=receiver value=x> 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 |
#3
|
|||
|
|||
value is correct.
Code:
<form method=post action='userdetails.php'><input type=hidden name=receiver value=42><input type=text size=6 name=money> <input type=submit value="Transfer" style='height: 23px'></form></td> This is my userdetail.php |
#4
|
||||
|
||||
find
Code:
<form method=post action='userdetails.php'> Code:
<form method=post action='userdetails.php?id=".$id."'> |
The Following User Says Thank You to djlee For This Useful Post: | ||
al_ltoticmat (21st October 2008)
|
#5
|
|||
|
|||
oh thx you very much.
My page is running. Very thx you. If I have another problems, can I ask you again? |
#6
|
||||
|
||||
as long as u post in the forums and dont pm me .. u'll be waiting an extremely long time for replies via PM
|
#7
|
|||
|
|||
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. |
#8
|
||||
|
||||
replace the print statement that says u dont have enough money with
Code:
print("Money: ".$money."<br /><br /><br />Allowed: ".$user['seedbonus']."<br /><br />"); |
#9
|
|||
|
|||
I see the errors.
Thank you It should be Code:
if ($money > $CURUSER["seedbonus"]) Code:
else { $receiver["seedbonus"] + $money; $CURUSER['seedbonus'] - $money; } |
#10
|
||||
|
||||
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']); |
The Following User Says Thank You to djlee For This Useful Post: | ||
al_ltoticmat (21st October 2008)
|
Tags |
code , problem |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ts code | xDev | Community Cafe | 8 | 13th February 2010 22:33 |
Pin Code | devil16 | Template Shares | 1 | 25th November 2009 02:14 |
Source code | DND | TBDev | 2 | 5th September 2009 18:22 |
Pin Code ban | Syn | Template Shares | 6 | 21st June 2009 02:03 |