Jump to content

Need help, trouble coding affiliate program


kpetsche20

Recommended Posts

I'm trying to code an affiliate program into my current website thotis dot com. Only problem is when I display the balance for an affiliate, it always make 1 row blank and the rest fill in fine.  You can replicate the problem by going to thotis  dot com  username: demouser pw: demo.

 

The table is format is shown below. Not sure if its even necessary but here it is anyway

 

id, userid, value, from, date, referral

 

 

<?php


                $host = 'localhost';
			$username = 'dbusername';
			$password = 'dbuserpw';
			$db = 'thotis_rw';
			$linkID = @mysql_connect("$host", "$username", "$password");
                mysql_select_db("$db", $linkID);

                $resultID = @mysql_query("SELECT * FROM `user_banking` WHERE `referral` = '$_SESSION[id]'", $linkID);
                $test = mysql_fetch_array($resultID);

			echo $test['referral'];
			for ($x= 0; $x < mysql_num_rows($resultID); $x++) {
                        $row = mysql_fetch_array($resultID);




		print "<tr><td width=\"192\" class=\"myaccount\">$$row[value]</td>
		<td width=\"193\" class=\"myaccount\">$row[from]</td>
		<td width=\"193\" class=\"myaccount\"> $row[referral]</td>

		</tr>\n";
                      
                }



?>

Thanks man, fixed the prob. I have another tho. I'm trying to add the Payout columns, but when I execute my code it gives me some weird numbers.

 

 

 

<?php

                // Current balance
                $host = 'localhost';
			$username = 'dfd';
			$password = 'dfd';
			$db = 'thotis_dfd';
			$linkID = @mysql_connect("$host", "$username", "$password");
                mysql_select_db("$db", $linkID);

                $resultID = @mysql_query("SELECT * FROM `user_banking` WHERE `referral` = '$_SESSION[id]'", $linkID);
               
			for ($x= 0; $x < mysql_num_rows($resultID); $x++) {
                        $row = mysql_fetch_array($resultID);


				$cur_bal = "0";
		 $cur_bal = $cur_bal + $row['value'];
                    
				echo $cur_bal;


		print "<tr><td width=\"192\" class=\"myaccount\">$$row[value]</td>
		<td width=\"193\" class=\"myaccount\">$row[from]</td>
		<td width=\"193\" class=\"myaccount\"> $row[referral]</td>

		</tr>\n";



                      
                }



?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.