Jump to content

Person

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

Everything posted by Person

  1. $con = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."<BR>"); mysql_select_db($dbname); $yesterday = date('20ymd', mktime(0, 0, 0, date("m") , date("d") - 1, date("Y"))); $query = 'SELECT' . ' user,' . ' sum(imps) AS imps,' . ' sum(clicks) AS clicks,' . ' sum(clientrev) AS clientrev' . ' FROM' . ' nuke_pnAffiliate_unauditedstats' . ' WHERE' . ' `date` = ' . $yesterday . ' AND ' . ' sid like \'%rpu%\' AND user IN (SELECT DISTINCT(cl) FROM rpu_sales WHERE salesman = \'ryan\')' . ' GROUP BY user' . ' ORDER BY clientrev DESC '; $result = mysql_query($query); $num_results = mysql_num_rows($result); while ($row = mysql_fetch_assoc($result)) { echo "<table>"; echo "<tr><td>".$row['user'] ."</td><td>". $row['imps'] ."</td><td>". $row['clicks'] ."</td><td>". $row['clientrev']."</td></tr>"; echo "</table>"; } $email_to = ""; $email_from = "MAil Server Total Clicks"; $email_subject = "I dont know that to name the other tables ?."; $email_body = "Content-Type: text/html; charset=UTF-8\n"; $email_body .= "Content-Transfer-Encoding: 8bit\n\n"; $email_body .= "<table>"; "<tr><td>".$row['user'] ."</td><td>". $row['imps'] ."</td><td>". $row['clicks'] ."</td><td>". $row['clientrev']."</td></tr>"; "</table>"; mail($email_to,$email_from,$email_subject,$email_body,"From:$email_from\are\nReply-To:do not reply to sever"); ?> This code prints this when echo : eflouret2589211629.2400002479553 mmblogpire909410526.4599993228912 uniquelink51337716.9799995422363 fosfor5327408.81999969482422 Darla3730316.84000015258789 jennklee1871295.48000001907349 stanzapub5435295.4799998998642 affiliate26006007215.28999996185303 anthroa25247244.52999997138977 iepurilah69582.01999998092651 lancelhoff7186101.88999998569489 10zenmonkeys420471.32000005245209 wildbluffmedia1198861.12999999523163 garrigus34651.09999999403954 emom73410.189999997615814 vwizard300 geeksaresexy636800 netceo1400 maloosh300 capablenetworks101900 mynetwork248800 qweszx200 now the E-mail part of this mail is not working.... i want it to print that data in a table in the E-mail that is being sent. But i dont know how to get it to print the data in the table. Right now the E-mail part does not print anything. thanks Brian
  2. I would want something that looks nice, and has a nice table thats easy to read.
  3. $con = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."<BR>"); mysql_select_db($dbname); $yesterday = date('20ymd', mktime(0, 0, 0, date("m") , date("d") - 1, date("Y"))); $query = 'SELECT' . ' user,' . ' sum(imps) AS imps,' . ' sum(clicks) AS clicks,' . ' sum(clientrev) AS clientrev' . ' FROM' . ' nuke_pnAffiliate_unauditedstats' . ' WHERE' . ' `date` = ' . $yesterday . ' AND ' . ' sid like \'%rpu%\' AND user IN (SELECT DISTINCT(cl) FROM rpu_sales WHERE salesman = \'ryan\')' . ' GROUP BY user' . ' ORDER BY clientrev DESC '; $result = mysql_query($query); $num_results = mysql_num_rows($result); while ($row = mysql_fetch_assoc($result)) { echo "<table>"; echo "<tr><td>".$row['user'] ."</td><td>". $row['imps'] ."</td><td>". $row['clicks'] ."</td><td>". $row['clientrev']."</td></tr>"; echo "</table>"; } $email_to = ""; $email_from = "MAil Server Total Clicks"; $email_subject = "I dont know that to name the other tables ?."; $email_body = "Content-Type: text/html; charset=UTF-8\n"; $email_body .= "Content-Transfer-Encoding: 8bit\n\n"; $email_body .= "<table>"; "<tr><td>".$row['user'] ."</td><td>". $row['imps'] ."</td><td>". $row['clicks'] ."</td><td>". $row['clientrev']."</td></tr>"; "</table>"; mail($email_to,$email_from,$email_subject,$email_body,"From:$email_from\are\nReply-To:do not reply to sever"); ?> Code works all the way up to the E-mail. Now i want to print the table in the E-mail.... how do i go about doing that without it giving me errors. As it is now its not printing the data in the E-mail.
  4. <?php $host = ""; $user = ""; $pass = ""; $dbname = ""; $con = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."<BR>"); mysql_select_db($dbname); $yesterday = date('20ymd', mktime(0, 0, 0, date("m") , date("d") - 1, date("Y"))); $query = 'SELECT' . ' user,' . ' sum(imps) AS imps,' . ' sum(clicks) AS clicks,' . ' sum(clientrev) AS clientrev' . ' FROM' . ' nuke_pnAffiliate_unauditedstats' . ' WHERE' . ' `date` = ' . $yesterday . ' AND ' . ' sid like \'%rpu%\' AND user IN (SELECT DISTINCT(cl) FROM rpu_sales WHERE salesman = \'ryan\')' . ' GROUP BY user' . ' ORDER BY clientrev DESC '; $result = mysql_query($query); $num_results = mysql_num_rows($result); while ($row = mysql_fetch_assoc($result)){ echo $row['user'] . $row['imps'] . $row['clicks'] . $row['clientrev'].'<br>'; } ?> how would i print those figures into a table? this is how it prints : eflouret2589211629.2400002479553 mmblogpire909410526.4599993228912 uniquelink51337716.9799995422363 fosfor5327408.81999969482422 Darla3730316.84000015258789 jennklee1871295.48000001907349 stanzapub5435295.4799998998642 affiliate26006007215.28999996185303 anthroa25247244.52999997138977 iepurilah69582.01999998092651 lancelhoff7186101.88999998569489 10zenmonkeys420471.32000005245209 wildbluffmedia1198861.12999999523163 garrigus34651.09999999403954 emom73410.189999997615814 vwizard300 geeksaresexy636800 netceo1400 maloosh300 capablenetworks101900 mynetwork248800 qweszx200
  5. nice that works... but how would i print those figures into a table? this is how it prints : eflouret2589211629.2400002479553<br>mmblogpire909410526.4599993228912<br>uniquelink51337716.9799995422363<br>fosfor5327408.81999969482422<br>Darla3730316.84000015258789<br>jennklee1871295.48000001907349<br>stanzapub5435295.4799998998642<br>affiliate26006007215.28999996185303<br>anthroa25247244.52999997138977<br>iepurilah69582.01999998092651<br>lancelhoff7186101.88999998569489<br>10zenmonkeys420471.32000005245209<br>wildbluffmedia1198861.12999999523163<br>garrigus34651.09999999403954<br>emom73410.189999997615814<br>vwizard300<br>geeksaresexy636800<br>netceo1400<br>maloosh300<br>capablenetworks101900<br>mynetwork248800<br>qweszx200<br>
  6. <?php $host = ""; $user = ""; $pass = ""; $dbname = ""; $con = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."<BR>"); mysql_select_db($dbname); $yesterday = date('20ymd', mktime(0, 0, 0, date("m") , date("d") - 1, date("Y"))); $query = 'SELECT' . ' user,' . ' sum(imps) AS imps,' . ' sum(clicks) AS clicks,' . ' sum(clientrev) AS clientrev' . ' FROM' . ' nuke_pnAffiliate_unauditedstats' . ' WHERE' . ' `date` = ' . $yesterday . ' AND ' . ' sid like \'%rpu%\' AND user IN (SELECT DISTINCT(cl) FROM rpu_sales WHERE salesman = \'ryan\')' . ' GROUP BY user' . ' ORDER BY clientrev DESC '; $result = mysql_query($query); $num_results = mysql_num_rows($result); $row = mysql_fetch_assoc($result); mysql_free_result($result); echo $row['user'] . $row['imps'] . $row['clicks'] . $row['clientrev']; ?> The accounts have differnt user names and i want to print the imps. clicks and clientrev for each user.... how would i go about doing that ? user imps clicks clientrev eflouret 28968 117 29.4699993133545 uniquelink 5585 91 20.0699996948242 affiliate2600 8808 36 9.06000018119812 thanks for the help
  7. so there is no way i can build the table around the data ? so if there is more data there is more parts of the table to populate ?
  8. Ok now that, that problem is fixed .... is there a way i can put a table round it ? Like in the mysql admin ? Is there some type of php code to do this ? or would i have to make the table the manual way ?
  9. its only printing clicks.... ? echo $row[clicks].$row[chcpc].$row[clcpc] ; Anyone know how it prints it in the Mysql admin ? Thats how i want it to print with the tables, but im new to this and have no idea how to do that...
  10. so how do i go about printing that ? would i just echo $row ?
  11. <?php $host = ""; $user = ""; $pass = ""; $dbname = ""; $con = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."<BR>"); mysql_select_db($dbname); $yesterday = date('20ymd', mktime(0, 0, 0, date("m") , date("d") - 1, date("Y"))); $query= "SELECT SUM(1) AS clicks, SUM(`clcpc`), SUM(`chcpc`) FROM `nuke_pnAffiliate_clicktracking` WHERE `pl` = 'rpu' AND `date` = '" . $yesterday . "'"; $result= mysql_query($query); $row= mysql_fetch_assoc($result); echo $result ; ?> should print : clicks SUM(`clcpc`) SUM(`chcpc`) 211 38.299999821931 84.569998212159 but it prints : Resource id #5 How do i fix this ?
  12. Warning: Invalid argument supplied for foreach() on line 68 67 } 68 foreach( $PARAMS[$page_name] as $param => $param_name ) { 69 if( isset($_REQUEST[$param]) ) {
  13. This is the error im getting ... any ideas ? Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/brian/imp.php on line 18 <?php $host = ""; $user = ""; $pass = ""; $dbname = ""; $con = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."<BR>"); mysql_select_db($dbname); $query = 'SELECT' . ' user,' . ' sum(imps) AS imps,' . ' sum(clicks) AS clicks,' . ' sum(clientrev) AS clientrev' . ' FROM' . ' nuke_pnAffiliate_unauditedstats' . ' WHERE' . ' `date` = ''20070418'' AND sid like ''%rpu%'' AND user IN (SELECT DISTINCT(cl) FROM rpu_sales WHERE salesman = ''ryan'')' . ' GROUP BY user' . ' ORDER BY clientrev DESC LIMIT 0, 30'; $result = mysql_query($query); $num_results = mysql_num_rows($result); $row = mysql_fetch_assoc($result); mysql_free_result($result); $email_to = ""; $email_from = ""; $email_subject = "."; $email_body = "Content-Type: text/html; charset=UTF-8\n"; $email_body .= "Content-Transfer-Encoding: 8bit\n\n"; $email_body .= " <TABLE BORDER=\"1\" CELLPADDING=\"0\" CELLSPACING=\"0\" WIDTH=\"500\" HEIGHT=\"70\"> <TR> <TD ALIGN=\"CENTER\" COLSPAN=\"3\" BGCOLOR=\"#1a467d\"> <B> RPU Sales yesterday for Ryan </B> </TD> </TR> <TR> <TD ALIGN=\"CENTER\" WIDTH=\"100\" BGCOLOR=\"#1a467d\"> <B> Clicks </B> <TD ALIGN=\"CENTER\" WIDTH=\"200\" BGCOLOR=\"#1a467d\"> <B> SUM(`clcpc`) </B> <TD ALIGN=\"CENTER\" WIDTH=\"200\" BGCOLOR=\"#1a467d\"> <B> SUM(`chcpc`) </B> </TR> <TR> <TD ALIGN=\"CENTER\" WIDTH=\"100\" BGCOLOR=\"#e36328\">" . $row['clicks'] . " <TD ALIGN=\"CENTER\" WIDTH=\"200\" BGCOLOR=\"#e36328\">" . $row['SUM(`clcpc`)'] . " <TD ALIGN=\"CENTER\" WIDTH=\"200\" BGCOLOR=\"#e36328\">" . $row['SUM(`chcpc`)'] . " </TD> </TABLE> "; mail($email_to,$email_from,$email_subject,$email_body,"From:$email_from\r\nReply-To:do not reply to sever"); ?> I did have to chance MySQL connection collation: to latin1_swedish1_ci could this have something to do to it ?
  14. I have the following script and its something that needs to run everyday. But is needs to give me the report for that day. Here is the script <?php $host = ""; $user = ""; $pass = ""; $dbname = ""; $con = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."<BR>"); mysql_select_db($dbname); $query = "SELECT SUM(1) AS clicks, SUM(`clcpc`), SUM(`chcpc`) FROM `nuke_pnAffiliate_clicktracking` WHERE `pl` = 'rpu' AND `date` > '20070228'AND `cl` IN (SELECT DISTINCT(cl) FROM rpu_sales WHERE salesman = 'ryan')"; $result = mysql_query($query); $num_results = mysql_num_rows($result); $row = mysql_fetch_assoc($result); mysql_free_result($result); $email_to = ""; $email_from = ""; $email_subject = ""; $email_body = "Content-Type: text/html; charset=UTF-8\n"; $email_body .= "Content-Transfer-Encoding: 8bit\n\n"; $email_body .= " <TABLE BORDER=\"1\" CELLPADDING=\"0\" CELLSPACING=\"0\" WIDTH=\"500\" HEIGHT=\"70\"> <TR> <TD ALIGN=\"CENTER\" COLSPAN=\"3\" BGCOLOR=\"#1a467d\"> <B> RPU Sales yesterday for Ryan </B> </TD> </TR> <TR> <TD ALIGN=\"CENTER\" WIDTH=\"100\" BGCOLOR=\"#1a467d\"> <B> Clicks </B> <TD ALIGN=\"CENTER\" WIDTH=\"200\" BGCOLOR=\"#1a467d\"> <B> SUM(`clcpc`) </B> <TD ALIGN=\"CENTER\" WIDTH=\"200\" BGCOLOR=\"#1a467d\"> <B> SUM(`chcpc`) </B> </TR> <TR> <TD ALIGN=\"CENTER\" WIDTH=\"100\" BGCOLOR=\"#e36328\">" . $row['clicks'] . " <TD ALIGN=\"CENTER\" WIDTH=\"200\" BGCOLOR=\"#e36328\">" . $row['SUM(`clcpc`)'] . " <TD ALIGN=\"CENTER\" WIDTH=\"200\" BGCOLOR=\"#e36328\">" . $row['SUM(`chcpc`)'] . " </TD> </TABLE> "; mail($email_to,$email_from,$email_subject,$email_body,"From:$email_from\r\nReply-To:do not reply to sever"); ?> How would I make this date variable ? for the day it is what its running ? $query = "SELECT SUM(1) AS clicks, SUM(`clcpc`), SUM(`chcpc`) FROM `nuke_pnAffiliate_clicktracking` WHERE `pl` = 'rpu' AND `date` > '20070228'AND `cl` IN (SELECT DISTINCT(cl) FROM rpu_sales WHERE salesman = 'ryan')";
  15. whats wrong with this query? SELECT user, sum(imps) AS imps, sum(clicks) AS clicks, sum(clientrev) AS clientrev FROM nuke_pnAffiliate_unauditedstats WHERE `date` = '20070418' AND sid like '%rpu%' AND user IN (SELECT DISTINCT(cl) FROM rpu_sales WHERE salesman = 'ryan') GROUP BY client ORDER BY clientrev DESC; thanks
  16. even on php my admin... it takes about 3 mins
  17. heres the code <?php $host = "localhost"; $user = ""; $pass = ""; $dbname = ""; $con = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."<BR>"); mysql_select_db($dbname); $query = "SELECT SUM(1) AS clicks, SUM(`clcpc`), SUM(`chcpc`) FROM `nuke_pnAffiliate_clicktracking` WHERE `pl` = 'rpu' AND `date` > '20070228'AND `cl` IN (SELECT DISTINCT(cl) FROM rpu_sales WHERE salesman = 'ryan')"; $result = mysql_query($query); $num_results = mysql_num_rows($result); $row = mysql_fetch_assoc($result); mysql_free_result($result); echo $result; ?> It brings up Resource id #5 where the myadmin brings up clicks SUM(`clcpc`) SUM(`chcpc`) 87343 3423.2699509561 12342.159823611
  18. I can get it to give me the info i need... i can get the info when i do it in php my admin... but when i run my code it takes long and nothing is echo'ed. There are 13 mil lines in the DB
  19. is there anyway to make this query more simple ? SELECT SUM(1) AS clicks, SUM(`clcpc`), SUM(`chcpc`) FROM `nuke_pnAffiliate_clicktracking` WHERE `pl` = 'rpu' AND `date` > '20070228'AND `cl` IN (SELECT DISTINCT(cl) FROM rpu_sales WHERE salesman = 'ryan')";
  20. now thats fixed ... next error <br /> <b>Warning</b>: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in <b>/home/brian/clicktracking.php</b> on line <b>7</b><br /> 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)<BR>[brian@first brian]$
  21. ok i have the following now <?php $host = "localhost"; $user = "user"; $pass = "pass"; $dbname = "user"; $con = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."<BR>"); mysql_select_db($dbname); $query = "SELECT SUM(1) AS clicks, SUM(`clcpc`), SUM(`chcpc`) FROM `nuke_pnAffiliate_clicktracking` WHERE `pl` = 'rpu' AND `date` > '20070228'AND `cl` IN (SELECT DISTINCT(cl) FROM rpu_sales WHERE salesman = 'ryan')"; echo $query $result= mysql_query($query); $num_results = mysql_num_rows($result); $row= mysql_fetch_assoc($result); mysql_free_result($result); echo $result ?> But this is the error i get <br /> <b>Parse error</b>: parse error, unexpected T_VARIABLE, expecting ',' or ';' in <b>/home/brian/clicktracking.php</b> on line <b>13</b><br />
  22. i would think so... but how would i put that all in php ?
  23. i think what it is doing is tracking clicks, and each line is a click. I dont know the tables either, but my guess would be that it is just adding lines.
  24. I need to Query a database with the following. SELECT SUM(1) AS clicks, SUM(`clcpc`), SUM(`chcpc`) FROM `nuke_pnAffiliate_clicktracking` WHERE `pl` = 'rpu' AND `date` = '20070418'AND `cl` IN (SELECT DISTINCT(cl) FROM rpu_sales WHERE salesman = 'ryan') What would be the best method ? Thanks in advanced
×
×
  • 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.