RON_ron
-
Posts
370 -
Joined
-
Last visited
Posts posted by RON_ron
-
-
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!
-
That's somewhat I'm trying to do here... Learning!
Could someone help me out?
-
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) );
-
Any suggestions in getting the COUNT?
-
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
-
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);
-
How to COUNT the number of records (pulled from a db)which contains the word "APPROVED". This code doesn't work though.
$result1;
$result2;
$result3;
$approvedApplicants = COUNT($result1=='Approved', $result2=='Approved', $result3=='Approved')
echo ($approvedApplicants)
-
Hi Ken.. that's brilliant.
But how can I get the COUNT if result1 of databaseA MATCH with result1 on databaseB and result2 of databaseA MATCH with result2 on databaseB, etc...
databaseA - result1, result2, result3...
databaseB - result1, result2, result3...
-
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.
-
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."'"); ?>
-
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.
-
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."'"); ?>
-
Thanks Pikachu2000!
-
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"; ?>
-
Hey Dan... those 3 lines is my full php file. I'm using this only to retrieve the time() in my timezone(+10) and as SECONDS.
This is for a countdown clock. Please help.
-
Thanks mate!
-
jim_keller . You are dead correct...
how can I get the time() in seconds?
E.g. Same as how it echo here;
<?php echo "time=" .time(); ?>
-
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
-
Can someone help me please...
-
I need to get the +10 timezone. But
1. The output for +10 is incorrect. Please help to fix it.
2. Is this a good way to get it?
<?php echo "time=" (.time() + 36000); ?>
-
Any suggestions?
-
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.
Is there a way to echo the time() of a particular timezone?
-
Help please...
-
Thanks Pikachu2000.
Could you tell me a solution to echo time in a nominated timezone in SECONDS?
Server time
in PHP Coding Help
Posted
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!