Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev
Reply
  #1  
Old 20th October 2008, 17:12
al_ltoticmat al_ltoticmat is offline
Senior Member
 
Join Date: Oct 2008
Posts: 44
Default 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.
Reply With Quote
  #2  
Old 20th October 2008, 19:09
djlee's Avatar
djlee djlee is offline
Senior Member
 
Join Date: Mar 2008
Posts: 183
Default
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
Reply With Quote
  #3  
Old 21st October 2008, 07:17
al_ltoticmat al_ltoticmat is offline
Senior Member
 
Join Date: Oct 2008
Posts: 44
Default
value is correct.

Code:
<form method=post action='userdetails.php'><input type=hidden name=receiver value=42><input type=text size=6 name=money>&nbsp;&nbsp;<input type=submit value="Transfer" style='height: 23px'></form></td>
userid is 42 and value is 42.

This is my userdetail.php
Attached Files
File Type: php userdetails.php (22.6 KB, 3 views)
Reply With Quote
  #4  
Old 21st October 2008, 08:32
djlee's Avatar
djlee djlee is offline
Senior Member
 
Join Date: Mar 2008
Posts: 183
Default
find
Code:
<form method=post action='userdetails.php'>
change to
Code:
<form method=post action='userdetails.php?id=".$id."'>
Reply With Quote
The Following User Says Thank You to djlee For This Useful Post:
al_ltoticmat (21st October 2008)
  #5  
Old 21st October 2008, 08:39
al_ltoticmat al_ltoticmat is offline
Senior Member
 
Join Date: Oct 2008
Posts: 44
Default
oh thx you very much.

My page is running. Very thx you.
If I have another problems, can I ask you again?
Reply With Quote
  #6  
Old 21st October 2008, 08:41
djlee's Avatar
djlee djlee is offline
Senior Member
 
Join Date: Mar 2008
Posts: 183
Default
as long as u post in the forums and dont pm me .. u'll be waiting an extremely long time for replies via PM
Reply With Quote
  #7  
Old 21st October 2008, 08:42
al_ltoticmat al_ltoticmat is offline
Senior Member
 
Join Date: Oct 2008
Posts: 44
Default
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.
Reply With Quote
  #8  
Old 21st October 2008, 08:48
djlee's Avatar
djlee djlee is offline
Senior Member
 
Join Date: Mar 2008
Posts: 183
Default
replace the print statement that says u dont have enough money with
Code:
print("Money: ".$money."<br /><br /><br />Allowed: ".$user['seedbonus']."<br /><br />");
see what it outputs
Reply With Quote
  #9  
Old 21st October 2008, 10:08
al_ltoticmat al_ltoticmat is offline
Senior Member
 
Join Date: Oct 2008
Posts: 44
Default
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.
Reply With Quote
  #10  
Old 21st October 2008, 10:17
djlee's Avatar
djlee djlee is offline
Senior Member
 
Join Date: Mar 2008
Posts: 183
Default
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)
Reply With Quote
The Following User Says Thank You to djlee For This Useful Post:
al_ltoticmat (21st October 2008)
Reply

Tags
code , problem

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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



All times are GMT +2. The time now is 14:29. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.