<?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 $result_1 ; // should it work?
print "Hello world";
mysql_close($conn);
?>
what is missing of this code? how to get result_1 print?
Moderator: General Moderators
-
WebbieDave
- Forum Contributor
- Posts: 213
- Joined: Sun Jul 15, 2007 7:07 am
-
sureshmaharana
- Forum Commoner
- Posts: 30
- Joined: Thu Jul 03, 2008 4:20 am
- Contact:
Re: what is missing of this code? how to get result_1 print?
Try this one:
<?
$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 .') as result";
$result_1 = mysql_query($query_1);
$row = mysql_fetch_array($result_1);
print $row['result'];
mysql_close($conn);
?>
<?
$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 .') as result";
$result_1 = mysql_query($query_1);
$row = mysql_fetch_array($result_1);
print $row['result'];
mysql_close($conn);
?>
Re: what is missing of this code? how to get result_1 print?
Thanks everyone.
It works !

It works !