/    Sign up×
Community /Pin to ProfileBookmark

function load_SpecialDays()

Hello before all, this is my first post here, ive got this function:

function load_SpecialDays() {
add_SpecialDay(“01-Jun-2008”, ‘booked’)
add_SpecialDay(“4/Jun/2008”, ‘booked’)
add_SpecialDay(“5-Jun-2008”, ‘booked’)
}

And this php code:

<?php
include ‘config.php’;
include ‘opendb.php’;
$query = “select arrival from confirmed where room_id = 1”;

$result = mysql_query($query);

while ($row = mysql_fetch_assoc($result)) {
list( $anio, $mes, $dia ) = explode( “-“, $row[‘arrival’] );
echo “add_SpecialDay($dia-$mes-$anio, ‘booked’)<br>n”;
}
?>

It prints on screen this:

add_SpecialDay(18-06-2008, ‘booked’)
add_SpecialDay(03-07-2008, ‘booked’)
add_SpecialDay(12-07-2008, ‘booked’)

Could i assign this result to the function, i mean could i assign value for this result to include on load_SpecialDays()?

Thanks in advance.
R3g@rd$.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@KorJun 04.2008 — If I well understood you could do something like this:
<i>
</i>&lt;?php
include 'config.php';
include 'opendb.php';
$query = "select arrival from confirmed where room_id = 1";

$result = mysql_query($query);
?&gt;
&lt;script type="text/javascript"&gt;
function load_SpecialDays(){
&lt;?php
while ($row = mysql_fetch_assoc($result)) {
list( $anio, $mes, $dia ) = explode( "-", $row['arrival'] );
echo "add_SpecialDay($dia-$mes-$anio, 'booked')&lt;br&gt;n";
}
?&gt;
}
&lt;/script&gt;
×

Success!

Help @akenateb spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...