<?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);
// ??How to print this result_1?
print $result_1; // did not work?
// what is the missing here?
// Thanks.
print "Hello world";
mysql_close($conn);
?>
How to print php result from mysql date ?
Moderator: General Moderators
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: How to print php result from mysql date ?
You only sent the query you did not fetch any results yet.
Use
Also, are you sure that sql query is valid?
Use
Code: Select all
$r = mysql_fetch_assoc($query_1);