Talos1 Posted September 8, 2013 Share Posted September 8, 2013 Hello, after 3 hours of insanity i figured i would reach out for some help. i am re-building a postback file that works off an API. i have got it to pay my members, but thr their referral person. Below is the code: <? $user = @$_GET['user']; $reward = @$_GET['reward']; $atefa = "alikiwife"; $date = date(“format”, $timestamp); $dates = date('d/m/Y - H:ia'); $entry_line = "$dates - $user has just completed Virool offer worth $reward PED. "; //give ENTER to break into new line in text file $fp = fopen("cback.txt","a"); fputs($fp,$entry_line); fclose($fp); $con = mysql_connect("localhost","dbname","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("dbname", $con); mysql_query("UPDATE members SET money=money+$reward, vwall=vwall+1 WHERE id='$user'"); mysql_close($con); ?> Now here is the issue, there is a field under each member in the database that is labled 'ref1' which is the id of the person who referred the member. The code line below pays the member the ammount due. but i need to add it to pay the refferer .001 or in essense 'ref1 money=money+.001' my problem is that i cannot get it to first call on the ref1 field so it is acutally editing the member who is the referer and edit their money field. This is the particular line i am having issues with. any suggestions would be greatly appreciated. mysql_query("UPDATE members SET money=money+$reward, vwall=vwall+1 WHERE id='$user'"); Thanks in advance, i am going crazy not being able to figure this out. Quote Link to comment https://forums.phpfreaks.com/topic/281967-postback-api-php-and-sql-issue/ Share on other sites More sharing options...
Talos1 Posted September 8, 2013 Author Share Posted September 8, 2013 (edited) Forgotton piece of info, the postback comes down this url http://websitedomain.com/virool_postback_yagazi.php?user=[USER_ID]&reward=[REWARD_USD]&skey=xxasot77pst Edited September 8, 2013 by Talos1 Quote Link to comment https://forums.phpfreaks.com/topic/281967-postback-api-php-and-sql-issue/#findComment-1448650 Share on other sites More sharing options...
Talos1 Posted September 8, 2013 Author Share Posted September 8, 2013 Bumping in hopes of getting a reply. Quote Link to comment https://forums.phpfreaks.com/topic/281967-postback-api-php-and-sql-issue/#findComment-1448722 Share on other sites More sharing options...
Talos1 Posted September 8, 2013 Author Share Posted September 8, 2013 A forum full of guys posting problems and 5% of them can get a helping hand. Lord i'm glad i signed up. LOL Hopeless, absolutly hopeless. Quote Link to comment https://forums.phpfreaks.com/topic/281967-postback-api-php-and-sql-issue/#findComment-1448761 Share on other sites More sharing options...
Talos1 Posted September 14, 2013 Author Share Posted September 14, 2013 Amazing. So i guess my next question is, does anybody know of a forum that can actually help with php coding questions? Quote Link to comment https://forums.phpfreaks.com/topic/281967-postback-api-php-and-sql-issue/#findComment-1449495 Share on other sites More sharing options...
Barand Posted September 15, 2013 Share Posted September 15, 2013 perhaps the clue is almost 500 views and no-one knows what you are talking about? Quote Link to comment https://forums.phpfreaks.com/topic/281967-postback-api-php-and-sql-issue/#findComment-1449505 Share on other sites More sharing options...
KevinM1 Posted September 15, 2013 Share Posted September 15, 2013 Like Barand said, your problem isn't exactly clear. We're not in the room with you. So, ask a better question, which includes what you're trying to do, what the expected results should be, what the actual results are (including all errors and warnings), and the relevant code (including database schema). Quote Link to comment https://forums.phpfreaks.com/topic/281967-postback-api-php-and-sql-issue/#findComment-1449517 Share on other sites More sharing options...
mac_gyver Posted September 15, 2013 Share Posted September 15, 2013 after reading the post a few times, i'm guessing you want to SELECT the ref1 value WHERE id = '$user' and then run an UPDATE query to add the .001 to the ref1 user's money or you could do this in one UPDATE query with a sub-query to get the ref1 value. where exactly are you stuck at in doing this? Quote Link to comment https://forums.phpfreaks.com/topic/281967-postback-api-php-and-sql-issue/#findComment-1449519 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.