<?php
$user='kdao';
$pass='khaidao';
$host='localhost';
$db='kdao';
$table='guessbook';
$conn = mysql_connect($host,$user,$pass) or die(mysql_error());
mysql_select_db($db,$conn);
$query_1 = "select concat('There are ',to_days('2008-10-15') - to_days(current_date()),' left to the special holiday .');
$result_1 = mysql_query($query_1);
print "Hello world";
mysql_close($conn);
?>
How to print php result from query without table?
Moderator: General Moderators
Re: How to print php result from query without table?
hi kdao
you had written every thing correctly but the minor mistake is you forgot to keep the " quotation at the end of the statement.
The proper format is
$query_1 = "select concat('There are ',to_days('2008-10-15') - to_days(current_date()),' left to the special holiday .')";
$result_1 = mysql_query($query_1);
echo mysql_result($result_1,0,0);
you will get the result without a table;
thanks and regards
parimala
you had written every thing correctly but the minor mistake is you forgot to keep the " quotation at the end of the statement.
The proper format is
$query_1 = "select concat('There are ',to_days('2008-10-15') - to_days(current_date()),' left to the special holiday .')";
$result_1 = mysql_query($query_1);
echo mysql_result($result_1,0,0);
you will get the result without a table;
thanks and regards
parimala