-
Posts
55 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
ffxpwns's Achievements

Member (2/5)
0
Reputation
-
It was an error in the code that was generating the output, wasn't it? No, I thought I had a solution, and I didn't, so I edited my post. But I'll try adding this :and r.referrer = u.nick after the where clause, see what happens. I think it's working, I think adding and r.email = u.email fixed it, but I'll do some testing.
-
It was an error in the code that was generating the output, wasn't it? No, I thought I had a solution, and I didn't, so I edited my post. But I'll try adding this :and r.referrer = u.nick after the where clause, see what happens.
-
IGNORE THIS, I'M AN IDIOT
-
Closer, here is the table it creates. That date registered value is someone else in the refer table with absolutely no relation to the user we're trying to to show the details for.
-
Oh, the dates are every other users registration dates, but it leaves the one we wanted empty. Any ideas? Agin, my code is $query = "SELECT u.reg_date, u.nick, u.email FROM ". $DBPrefix."users AS u JOIN ". $DBPrefix."refer AS r WHERE r.referrer = '$userName'"; $res = mysql_query($query); $system->check_mysql($res, $query, __LINE__, __FILE__); while($row = mysql_fetch_assoc($res)) { $template->assign_block_vars('refer', array( 'REGDATE => $row['reg_date'] )); }
-
Well, I feel like a right proper dumbass. one weird thing though, I only have one row in 'refer' and the email has an account attached to it, but it shows up like this
-
Oh, and because I'm lazy, $userName = $user->user_data['id']; so userName is ID.
-
Alrighty. I modified the code to use ID's, but I may work on the code thing later. But how would I put these results on the TPL file? Currently it's $query = "SELECT u.reg_date, u.username, u.email FROM". $DBPrefix. "users AS u JOIN". $DBPrefix ."refer AS r WHERE r.referrer = '$userName'"; $res = mysql_query($query); $system->check_mysql($res, $query, __LINE__, __FILE__); while($row = mysql_fetch_assoc($res)) { $template->assign_block_vars('fbs', array( 'REGDATE' => $row['reg_date'], )); } But it doesn't work, this error comes up: Database access error. SELECT u.reg_date, u.nick, u.email FROM Auc_users AS u JOIN Auc_refer AS r WHERE r.referrer = 'testuser' 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 'AS u JOIN Auc_ refer AS r WHERE r.referrer = 'testuser'' at line 2 page:/.../reflist.php line:42 Also, how would I display the data? Before I used $template->assign_block_vars('refer', array( 'REFEMAIL' => $row['email'], But I assume that would have to change
-
This is going to be complicated to explain, so please bear with me. I have a tables called 'users' within that table, I have columns 'reg_date' (when the user registered) and 'email'. Then, I have a table called 'refer'. Within that, I have 'referrer' (who sent out a referral) and 'email' (who the referral email was sent to). When displaying this information, I want to display the day that someone registered (reg_date) when the email from 'users' equals the email from 'refer'. And it only displays this information to the 'referrer'. If that needs clarification, let me know. Here is my code so far: (The first query works totally fine. it's the second one) $userName = $user->user_data['nick']; // Get details $query = "SELECT email, date FROM " . $DBPrefix . "refer WHERE referrer = '".$userName."'"; $res = mysql_query($query); $system->check_mysql($res, $query, __LINE__, __FILE__); while($row = mysql_fetch_assoc($res)) { $template->assign_block_vars('refer, array( 'EMAIL' => $row['email'], 'DATE' => date('d/m/Y', $row['date']) )); } $query = "SELECT reg_date FROM " . $DBPrefix . "users WHERE email = 'email FROM " .$DBPrefix. " refer AND referrer = '".$userName."'"; $res = mysql_query($query); $system->check_mysql($res, $query, __LINE__, __FILE__); while($row = mysql_fetch_assoc($res)) { $template->assign_block_vars('refer', array( 'REFEMAIL' => $row['email'], )); }
-
It did not. And, if it means anything, the permissions are 777.
-
Would it work if I put it on another file and used it as in include? I'll try that and report back.
-
In the common.inc.php, system is $system = new global_class();
-
Also, when I use my old code (below) and I put the $refername or $referrer or whatever it is above the code, and I echo $query, it echos UPDATE DataBase_users SET balance = balance + 5 WHERE refer = ''. Almost as if it doesn't recognize it or something. And I'm sure my spelling is correct . I'm pretty sure PHP is out to get me. CODE: $query = "UPDATE ".$DBPrefix."users SET balance = balance + 5 WHERE refer = '".mysql_real_escape_string($referName)."'"; $res = mysql_query($query); $system->check_mysql($res, $query, __LINE__, __FILE__); $gateway_data = mysql_fetch_assoc($res); $referName = $gateway_data['refer']; $query = "UPDATE ".$DBPrefix."users SET refer = '' WHERE nick = '".mysql_real_escape_string($referred)."'"; $res = mysql_query($query); $system->check_mysql($res, $query, __LINE__, __FILE__); $gateway_data = mysql_fetch_assoc($res); $referred = $gateway_data['nick'];
-
Thanks! Everyone love puppies. Now when I comment it out, no error is incited. But nothing happens to the balance / refer fields.
-
I know it's frowned upon to bump a post, but I am so lost and I need to get this done. Could someone please help me figure out why I'm getting that error? This is how I feel.