Hi everyone,
This is my sql query:
When I run it on my MySQL display this is what I get:
I'd like that query to be operated usin PHP code. This is my code:
When I run my php code this is what I get:
Why do I not get the desired result from my PHP as in my MySQL display?
Thanks
This is my sql query:
Code:
SELECT HOUR(TIMEDIFF('16:55','16:45')) + MINUTE(TIMEDIFF('16:55','16:45'))/60;
I'd like that query to be operated usin PHP code. This is my code:
Code:
<?php //MyINITIAL.PHP
$MyHOST = 'localhost';
$MyUSER = 'yossi';
$MyPASS = 'yoss4qpines';
$MyDB = 'test';
?>
Code:
<?php //MyLOGIN.PHP
$MyCONNECTION = NEW MYSQLI($MyHOST,$MyUSER,$MyPASS,$MyDB);
IF(!$MyCONNECTION)
DIE('Gevald' .MYSQLI_CONNECT_ERROR());
MYSQLI_SET_CHARSET($MyCONNECTION,'UTF8');
?>
Code:
<?php // to_forum.php
REQUIRE_ONCE 'MyINITIAL.php';
REQUIRE_ONCE 'MyLOGIN.php';
$MyCONNECTION = NEW MYSQLI($MyHOST,$MyUSER,$MyPASS,$MyDB);
IF(!$MyCONNECTION)
DIE(MYSQLI_CONNECT_ERROR());
MYSQLI_SET_CHARSET($MyCONNECTION,'UTF8');
$aaa=time('16:50');
$bbb=time('16:55');
$ccc="select hour(timediff('$bbb','$aaa')) + MINUTE(TIMEDIFF('$bbb','$aaa'))/60;";
$result = $MyCONNECTION->query($ccc);
if(!$result) echo $MyCONNECTION->error;
else
$res = $result->fetch_array(MYSQLI_NUM);
print_r($res);
?>
Why do I not get the desired result from my PHP as in my MySQL display?
Thanks