Jump to content

RON_ron

Members
  • Posts

    370
  • Joined

  • Last visited

Posts posted by RON_ron

  1. Sorry - I'm 13 in few days time.

     

    Everything what I know is from my mistakes and from form experts like you. Also do you expect someone to read the manual for any simple question? Then why are the forums are for?

     

    Anyway... from recent time most of the experts tend to just point to the MANUAL - but I personally feel there should be some guide to the question + a link to the correct page on the Manual. That helps creating more experts to the world much quicker.

     

    p.s. you were me few years ago - How happy would you have been when someone helps you get the code working and understand how it works - specially if you did this when you are 13!

  2. I'm not sure if this is the place to ask this question, but please advise

     

    <?php
    echo "time=" . time();
    ?>

     

    does the time change when viewing in other countries?

    E.g. Is echo the same when viewed in China, US, New Zealand?

     

    Thanks!

  3. Help in fixing this.

     

    $SomeVar = 'myname';
    $like = "SELECT Fielda, Fieldb, Fieldc, Fieldd, Fielde, Fieldf, Fieldg, Fieldh FROM db1 WHERE subjectz = '".$SomeVar."'";
    $y= explode("Banned", $like);
    
    $ArrayUsrD = array($like);
    $ArrayMrkD = array($y);
    
    $countF = count( array_intersect($ArrayUsrD, $ArrayMrkD) );

  4. No.

     

    $SomeVar = 'myname';
    $like  = count("Fielda, Fieldb, Fieldc, Fieldd, Fielde, Fieldf, Fieldg, Fieldh LIKE '%".implode("%' OR Fielda, Fieldb, Fieldc, Fieldd, Fielde, Fieldf, Fieldg, Fieldh LIKE '%", explode('Banned'))."%'WHERE news_idz = '".$SomeVar."'");
    echo($like);

     

    I'm getting these ERROR messages;

     

    Warning: Wrong parameter count for explode()

    Warning: implode() [function.implode]: Invalid arguments passed

     

  5. I want to get the COUNT if any of these fields (Fielda, Fieldb, Fieldc, Fieldd, Fielde, Fieldf, Fieldg, Fieldh) contain the word "Banned". But this code doesn't work.

     

    $like  = count("Fielda, Fieldb, Fieldc, Fieldd, Fielde, Fieldf, Fieldg, Fieldh LIKE '%".implode("%' OR Fielda, Fieldb, Fieldc, Fieldd, Fielde, Fieldf, Fieldg, Fieldh LIKE '%", explode('Banned'))."%'");
    echo($like);

  6. I've spot the coding error and fixed it. it works... but not the way I expected.

     

    I'm expecting  this would return the count like this;

    E.g.

    Assuming database A holds these records

    $scoreP['roundzAa']; holds "AUS"

    $scoreP['roundzAb']; holds "AUS"

    $scoreP['roundzAc]; holds "AUS"

    $scoreP['roundzAd']; holds "RUS"

    $scoreP['roundzAe']; holds "RUS"

     

     

    Assuming database B holds these records

    $scoreM1['winxa']; holds "US"

    $scoreM1['winxb']; holds "AUS"

    $scoreM1['winxc']; holds "UK"

    $scoreM1['winxd']; holds "RUS"

    $scoreM1['winxe']; holds "AUS"

     

    echo = 2//match the results by ORDER and echo the COUNT.

  7. I hope this is the way to do this. But it's giving me an error.

    Parse error: syntax error, unexpected ',' in /home/....../TEST.php on line 108

     

    $SomeVar = myname;
    $queryU =  "SELECT * FROM adxone WHERE username = '".$SomeVar."'";
    $resultU = mysql_query($queryU);
    $scoreU = mysql_fetch_assoc($resultU);
    $userRa1 = $scoreU['roundzAa'];
    $userRa2 = $scoreU['roundzAb'];
    $userRa3 = $scoreU['roundzAc'];
    $userRa4 = $scoreU['roundzAd'];
    $userRa5 = $scoreU['roundzAe'];
    $userRa6 = $scoreU['roundzAf'];
    $userRa7 = $scoreU['roundzAg'];
    $userRa8 = $scoreU['roundzAh'];
    
    $WinV = 'resultA';
    $query =  "SELECT * FROM acs WHERE resultx = '".$WinV."'";
    $result = mysql_query($query);
    $scoreM = mysql_fetch_assoc($result);
    $winRa1 = $scoreM['markwinxa'];  
    $winRa2 = $scoreM['markwinxb']; 
    $winRa3 = $scoreM['markwinxc']; 
    $winRa4 = $scoreM['markwinxd']; 
    $winRa5 = $scoreM['markwinxe']; 
    $winRa6 = $scoreM['markwinxf']; 
    $winRa7 = $scoreM['markwinxg']; 
    $winRa8 = $scoreM['markwinxh']; 
    
    $ArrayUsr=array($userRa1, $userRa2, $userRa3, $userRa4, $userRa5, $userRa6, $userRa7, $userRa8),
    $ArrayMrk=array($winRa1, $winRa2, $winRa3, $winRa4, $winRa5, $winRa6, $winRa7, $winRa8, ),
    
    $count1 = count( array_intersect($ArrayUsr, $ArrayMrk) );
    echo($count1);
    
    mysql_query("UPDATE comp SET id=$count1 WHERE username = '".$SomeVar."'");
    ?>

  8. Sorry!!!!!!!!

    Here's the code. But this sends the count 0 all the time??

     

    Also an error message

    Warning: array_intersect() [function.array-intersect]: Argument #1 is not an array in /home/...../TEST.php on line 36

     

    $SomeVar = myname;
    $queryU =  "SELECT * FROM adxone WHERE username = '".$SomeVar."'";
    $resultU = mysql_query($queryU);
    while($scoreP = mysql_fetch_array($resultU))
    {
    echo $scoreP['roundzAa'];
    echo $scoreP['roundzAb'];
    echo $scoreP['roundzAc'];
    echo $scoreP['roundzAd'];
    echo $scoreP['roundzAe'];
    echo $scoreP['roundzAf'];
    echo $scoreP['roundzAg'];
    echo $scoreP['roundzAh'];
    }
    
    $WinV = 'resultA';
    $query =  "SELECT * FROM acs WHERE resultx = '".$WinV."'";
    $result = mysql_query($query);
    while($scoreM1 = mysql_fetch_array($result))
    {
    echo $scoreM1['winxa'];  
    echo $scoreM1['winxb']; 
    echo $scoreM1['winxc']; 
    echo $scoreM1['winxd']; 
    echo $scoreM1['winxe']; 
    echo $scoreM1['winxf']; 
    echo $scoreM1['winxg']; 
    echo $scoreM1['winxh']; 
    }
    
    $count1 = count( array_intersect($resultU, $result) );
    echo($count1);
    
    mysql_query("UPDATE comp SET id=$count1 WHERE username = '".$SomeVar."'");
    ?>

     

    I'm expecting  this would return the count like this;

    E.g.

    Assuming database A holds these records

    $scoreP['roundzAa']; holds "AUS"

    $scoreP['roundzAb']; holds "AUS"

    $scoreP['roundzAc]; holds "AUS"

    $scoreP['roundzAd']; holds "RUS"

    $scoreP['roundzAe']; holds "RUS"

     

     

    Assuming database B holds these records

    $scoreM1['winxa']; holds "US"

    $scoreM1['winxb']; holds "AUS"

    $scoreM1['winxc']; holds "UK"

    $scoreM1['winxd']; holds "RUS"

    $scoreM1['winxe']; holds "AUS"

     

    echo = 2//match the results by ORDER and echo the COUNT.

  9. I can't get the COUNT of the matching results? Please help.

     

     

    $SomeVar = myname;
    $queryU =  "SELECT * FROM adxone WHERE username = '".$SomeVar."'";
    $resultU = mysql_query($queryU);
    while($scoreP = mysql_fetch_array($resultU))
    {
    $scoreP['roundzAa'];
    $scoreP['roundzAb'];
    $scoreP['roundzAc'];
    $scoreP['roundzAd'];
    $scoreP['roundzAe'];
    $scoreP['roundzAf'];
    $scoreP['roundzAg'];
    $scoreP['roundzAh'];
    }
    
    
    $WinV = 'resultA';
    $query =  "SELECT * FROM acs WHERE resultx = '".$WinV."'";
    $result = mysql_query($query);
    while($scoreUsr = mysql_fetch_array($result))
    {
    $scoreUsr = $scoreM1['winxa'];  
    $scoreUsr = $scoreM1['winxb']; 
    $scoreUsr = $scoreM1['winxc']; 
    $scoreUsr = $scoreM1['winxd']; 
    $scoreUsr = $scoreM1['winxe']; 
    $scoreUsr = $scoreM1['winxf']; 
    $scoreUsr = $scoreM1['winxg']; 
    $scoreUsr = $scoreM1['winxh']; 
    }
    
    $count1 = count( array_intersect($resultU, $result) );
    echo($count1);
    
    mysql_query("UPDATE comp SET id=$count1 WHERE username = '".$SomeVar."'");
    ?>

  10. How can I get the results of CODE B in seconds? I need the result of CODE B to be similar as the result in CODE A. Basically what I need is CODE B to echo in seconds.

     

    CODE A

    <?php

    date_default_timezone_set('Australia/Melbourne');

    echo "time=" .time();

    ?>[/code]

     

    CODE B

    <?php
    $tz =  new DateTimeZone('Australia/Melbourne');
    $date = new DateTime('now', $tz);
    echo $date->format('Y-m-d H:i:s') . "\n";
    ?>

     

     

  11. How to check if a result of a database match with a result of another database. How do  this?

     

    E.g.

    In DatabaseA holds a column called usernames.

    In DatabaseB holds a column called banned.

     

    Is it possible to match results of an Array with an Arrary of results of another database and COUNT the matching results?

     

    E.g.

    In DatabaseA holds 4 columns and the records are pulled in as an array.

    Science

    Geography

    Accounting

    Agriculture

     

    In DatabaseB holds 4 columns and the records are pulled in as an array.

    Geography

    French

    Accounting

    Science

     

    THE RESULT should echo = 1

  12. Hi MrXHellboy...

    I want to echo the time() of "Antarctica/Palmer"

     

    As in my very first post, I'm unable to echo the time of the specified timezone - it always echo the GMT. :shrug:

     

    Is there a way to echo the time() of a particular timezone?

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