Hmm, I added my .httpaccess and changed my ‘local host’ but it seems your system doesn’t use $con->Query as its now Boolean also I note differences in getting fetch row not working pulling next row this is different to I guess why can you all use same page book it would make this so much easier with standardisation [rant over] I also notice getPDT($current_playing[‘datetime’]); doesn’t work does this system not support getPDT? or is my whole SQL going to have to change to new msql protocols ?
Edwin some of it but not all on wordpress. I cant find some url in it that point to old crap site .i am also having to try get data together from oddments as old site serer people does not understand Information Act and trashed my site. I migrated what I could so far but /wp_login wont work idk. I didn’t know my old server didn’t support Php 8 so have not written it for that but it used too on there crap service server . This one seems much better. It also doesn’t seem to have uploaded data yet .
I still have to work out why i cant have echo “spade “.” bucket”; I don’t understand explanation given I think I need ‘new msql()’ etc for php 8 ?
I don’t think this is a function… if you’re looking for the Pacific Timezone, use date_default_timezone_set('America/Los_Angeles'). If that’s not it, please elaborate .
$datetime1 is not defined, $row["datetime"] is not defined.
It supposed to be simple right now.
The hardest question is You need to login your wp-admin on infinity free.
Since there a crush though on wp-admin login. You should upload your files manually. You can use filezilla or filemngr. Why you need to login on wp-admin ? You can replace your wp-admin login by doing thoze stuff on localhost. Upload the result file then.
Hi Wacky thanks but
I am also trying to convert data from sql to Pacific Date Tim a in $newDT = getPDT($row[‘datetime’]); which fails as its unix from my old site . Can you help on how to convert it without unix GetPDT(
Yes but had this why does it give error Notice : Undefined variable: current_playing in /home/vol1_2/epizy.com/epiz_33087480/htdocs/music_now_playing.php on line 197 because I call it please ?
function getPDT($datetime2) {
// ****************** time zone things not used currently shows GMT
//$baseTimezone = new DateTimeZone('CST'); // Central Standard Time Zone -6
$baseTimezone = new DateTimeZone('America/Denver'); // timezone of datetime on DB
$userTimezone = new DateTimeZone('America/Los_Angeles');
$DBDate = new DateTime($datetime2, $baseTimezone);
$DBoffset = $baseTimezone->getOffset($DBDate);
$userDate = new DateTime($datetime2, $userTimezone);
$USERoffset = $userTimezone->getOffset($userDate);
// create a DateInterval Object with the corrected difference between DB and required
$myInterval = new DateInterval('PT'. abs($DBoffset - $USERoffset) . 'S');
if ( $USERoffset < $DBoffset) {
$myInterval->invert = 1;
}
return $DBDate->add($myInterval);
}
Ok here is my login fetch bits as requested Edwin . it all parses a php app to check syntax Hopefully you will see something I cant and please enlighten me ?
$con = new mysqli($servername,$username,$password,$dbname);
if ($con -> connect_errno) {
echo "Failed to connect to MySQL: " . $con-> connect_error;;
}else{
echo "";
}
sql = "SELECT `datetime`,`artist`,`song`,`album`,`comment` FROM `played_songs` ORDER BY `datetime` DESC";
$result = mysqli_query($con, $sql);
$n=0;
if($result->num_rows>0)
{
$current_playing = $result->fetch_assoc();
while($row=$result->fetch_assoc())
{
$n++;
// etc.
}
}
On line 195 of the music_now_playing.php is a closing curly bracket. That means that all code below that will execute even if $result->num_rows>0 returns false (which means no rows were returned and the $current_playing = $result->fetch_assoc(); line was never executed).
Judging by the indentation, I think that closing bracket should be around line 250.
Hmm I keep getting this error Parse error : syntax error, unexpected ‘}’, expecting end of file in /home/vol1_2/epizy.com/epiz_33087480/htdocs/music_now_playing.php on line 177 on line p 238 this is closed so cant see the error why it says ‘}’ in unexpected are they not supposed to be balanced? Or is the something wrong with the PDO code I inserted?