Jump to content

testing7

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

testing7's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i posted this code: <?php $total= mysql_query("SELECT user, COUNT(user) AS user_total FROM referrals GROUP BY user"); echo '<tr>'; while($row = mysql_fetch_array($total)) { echo '<td>User: '.$row['user'].', Count: '.$row['user_total'].' / </td>'; } ?> getting the error on this line: echo '<tr>';
  2. hmm im getting an error with that code: Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/public_html/board21.php on line 52
  3. basically i have a referral column that saves the username of the referral now what i would like to do is add up that persons referral count. so say their name comes up 10 times in the column i would be able to output a 10 so they can see how many referrals they have gotten. not even sure this is the right way to start but this is what i came up with (let me know if it looks right or completely wrong because i suck) <?php $total="SELECT SUM(user) AS user_total FROM referals WHERE user = user"; // user = user cant be right can it? $result=mysql_query($total); print "<tr>"; while($row = mysql_fetch_array($result)) { //Here is where im confused $sum = $row['user_total']; print "<td>Sum: $sum </td>"; } ?> am i way off? or can it even be done?
  4. nice. thats pretty straight forward so i will have to add that. im still learning so every little bit helps. i just wanted to make sure i wasnt going to run a command that was going to screw up anything.
  5. table name = users columnA = points columnB = paypal if their is a value in paypal other than null i want to reset points to 0 in table name users
  6. i just need to know how to do it. we are not a huge site and dont have a large budget for good database design. thanks in advance
  7. what do you mean by that? im just trying to reset a points column to 0 after payments are sent out to my users.
  8. this is probably a simple command but i want to make sure it is right before i run it my ultimate goal is to reset points to 0 in columnA if columnB has a email address in it. right now columnB is null unless they have input a email address basically they get points in columnA for every click they get on their link and if they have a email address in columnB i am going to pay them and reset their points to 0 but if they dont have an email in columnB their points will stay until next months payout where i will run the command again anyways does this look right? UPDATE table IF columnB=(this is where im confused) SET columnA=0 ; im not sure what i need to put in the email spot because each email is different and im not sure if set =0 is right either. im sure this is easy but im the noob you will have to excuse me. thanks in advance
  9. im sure i am missing something simple. but this is killing me. i get this to work: $url = (isset($_POST['url'])) ? $_POST['url'] : ''; $BlockedNames = array('nepwk', 'teleworm'); $BlockedDomains = array('nepwk.com', 'teleworm.com', 'yopmail.com', 'adf.ly', 'www.nepwk.com'); @list($name, $domain) = explode("http://", $url); else if(in_array($name, $BlockedNames) || in_array($domain, $BlockedDomains)) { $mesaj = "<div class=\"msg\"<div class=\"error\">Your URL has been blocked by our system!</div></div>"; } now the above works if i type the whole domain for every single url i want to block but i want to know is how would i add a catch all of sorts to the domain so say the domain is: http://www.google.com i want to block everything google so all of the following would be blocked as well http://www.google.com/whatever http://www.google.com/anything http://www.google.com/something i want all of those to be blocked automatically without having to add each individual one im trying to block adf.ly links which change for each person and each url they mask and i want to take proactive measure to just block them from being added into my form instead of having them added to my database then having to go and manually delete them. any questions or if this doesn't make sense let me know. thanks in advance (and maybe this is bad code im a noob so go easy )
×
×
  • 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.