Jump to content

Wildhalf

Members
  • Posts

    101
  • Joined

  • Last visited

Posts posted by Wildhalf

  1. Kicken, Sorry for being so confusing.

     

    Basically i am building a rotator script.

     

    Here is how my database looks:

     

    rotator.png

     

    both id & fb_user_id are unique for every entry.

     

    What i am doing is building a kind of affiliate system with signup page with a form. I am rotating the sponsors link on the page so they are in order related to who joined first. When someone gets a signup they are put on the end of the rotation again untill they have say 2 signups.

     

    So when a new user signs up via the rotator page the order goes from

     

    fb_user_id - oder

    1 - 1

    2 - 2

    3 - 3

     

    to this

     

    fb_user_id - oder

    1 - 4

    2 - 1

    3 - 2

    4 - 3

     

    so the new member goes in 3rd in line and the person who referred them goes in right behind them in 4th unless that had been there 2nd signup in this case they will no longer be in the rotation.

     

    Do you have any more questions?? Hope this makes it a bit clearer

  2. I Have asked on stack overflow but im not getting a good answer so decided to come here.

     

    I am a learn as you go php programmer.... but think i am a bit out data by the looks of things any way if you look at the following question it will show you what i am trying to do

     

    http://stackoverflow.com/questions/13238787/php-select-update-statement-to-return-and-update-a-multi-dimensional-array

     

    &

     

    http://stackoverflow.com/questions/13117872/php-rotate-and-adding-to-an-array

     

    thanks in advance to anyone who can help

  3. I am new to SESSIONS and have a quick question about them.

     

    I want to use sesssions on my site but was wondering if they would work for the follow senario.

     

    Say a customer visits my url: http://www.mysite.com/?id=2

     

    Now what i am doing is taking the id out of the URL using sessions and redirecting the user to  http://www.mysite.com while my session ($_SESSION['id']) holds the value 2 in it. I have this working great, i believe it just looks better.

     

    Now if my customer decides to buy my product via paypal and is directed off my site while he/she is paying for said item on paypal when they return could i still use some of the information that i stored in my session??

     

    I know i could use post and get to pass through paypal but unfortunately i have to use sessions for what i am trying to do.

     

  4. I am only going to be using the ID on one page. Say i have 10 different ID's 1 to10. All i am doing is when i send a user to ?ID=1 it displays one thing taken from my database. ?ID=2 displays something else and so on.

     

    I suppose i dont now enough about php to do it but i know what i want done works as i have seen it with a few scripts.

  5. I am passing variable to a PHP page and was wondering if there is a way to clean these varilabes from the url once i pull the information out of it.

     

    For example my URL is "http://www.MYURL.com/index.php?var1=TEST1&var2=TEST2"

     

    Now what i want to be able to do is when someone visits the above link i want to assign var1 and var2 to a variable

    and then remove then from the addressbar so the vistor can only see the base URL (http://www.MYURL.com) in the address bar but i get my variables

     

    Anyone know what i can use???

     

  6. $sponsor_email is an array of 4 email addresses assigned $sponsor_email[0], $sponsor_email[1], $sponsor_email[2], $sponsor_email[3], $sponsor_email[4]

     

    If i replace the i in $sponsor_email with either 1,2,3,4 it displays the right result for each mail 4 times.

     

    Does anyone know why the for lop isnt working with the i in the select statement......

     

    for ($i = 0; $i <= 4; $i++) {
    $get_number_sales_sql = "SELECT * FROM worthatry_spon WHERE aff_email = '$sponsor_email[i]'";
    $get_number_sales_res = mysql_query($get_number_sales_sql) or die("An internal error has occured!<br />Unable to run the following query:<br /><pre>" . $qry. "</pre><br /><br />" . mysql_error());
    $get_number_sales = mysql_fetch_array($get_number_sales_res);	
    
    $aff_member_sales[i] = $get_number_sales[number_sales];
    $aff_member_email[i] = $get_number_sales[aff_email];
    
    echo $aff_member_sales[i];
    echo '<Br>';
    echo $aff_member_email[i];
    echo '<Br>';
    }	
    

  7. Hi i want to search my table for a few specific enteries shown in the code below

     

    $multi_sql = "SELECT spon_email_1, spon_email_2,spon_email_3,spon_email_4,spon_email_5 FROM worthatry_spon WHERE aff_email = 'kieron@webdesign4u.ie'";
    	$multi_res = mysql_query($multi_sql) or die("An internal error has occured!<br />Unable to run the following query:<br /><pre>" . $qry. "</pre><br /><br />" . mysql_error());
    	$multi = mysql_fetch_array($multi_res);	
    

     

    Now this SQL state works and returns exactly what i want it to. now once i have this information i would like to turn this array into a multidemensional array.

     

     

    I want the array to be 3 levels. ie ARRAY[1st_email][2nd_email][3rd_email] , now the results from the sql above are to be the list of 1stemails.

    I then want to search my table again and add the corresponding results to 2n_email positions in the array. And lastly with the 2nd_email results

    i want to search table again and return the 3rd_emails.

     

    Hope that helps. Anyone know how to convert my array into a multi-demensional array???

  8. I'm using a script but want tp pass a variable through paypal. Is it as easy as using post and get fromt he url??

     

    Also i am not sure if it will be possible to do the above with the script im using so is there another way, like writing a cookie on the users pc or on my host and then reading it once im though paypal??

  9. You have an erro in your sql query if your are getting that error, what does the following return:

    $query = 'SELECT * FROM name';
    $getData = mysql_query($query) or die('SQL Query Error: ' . mysql_error() . '<br />Query: <pre>' . $query . '</pre>');
    while ($result = mysql_fetch_assoc($getData))
    {
        echo $result['fieldname'] . "<br />";
    }

     

    Came back with

     

    SQL Query Error: No database selected

     

     

  10. Have you actually opened a connection to mysql?

    Show us all your code.

     

     

    Heres my code

     

     <?php
    $con = mysql_connect("localhost","pagination","abc123");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }
    
    
    $rowData = array();
    $getData = mysql_query('SELECT * FROM test');
    while ($rowData = mysql_fetch_assoc($getData))
    {
    echo $rowData['name'] . "<br />";
    }                                                
    
        // Include the pagination class
        include 'pagination.class.php';
        // Create the pagination object
        $pagination = new pagination;
        // parse the data
        $dataPages = $pagination->generate($rowData, 20);
    
        foreach ($dataPages as $dataKey => $dataArray) {
        // Show the information about the item
        echo '<p><b>'.$dataArray['fieldname'].'</b> '.$dataArray['fieldname2'].'</p>';
        } 
    
          ?>

×
×
  • 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.