In Progress

Simple Php script different rules based on server time

Php script needs to be using else/else if or switches, with the default or final else as doing either nothing or something I choose.

Here's a mock up:

If 12 AM

include

$result = mysql_query('SELECT * FROM `ads` WHERE `advertiser_id` = 14 and `toShow` = 1');

if (mysql_num_rows($result) > 0)

echo '<script type="text/javascript" src="my.js"></script>';

else if 1 AM

include

$result = mysql_query('SELECT * FROM `ads` WHERE `advertiser_id` = 15 and `toShow` = 1');

if (mysql_num_rows($result) > 0)

echo '<script type="text/javascript" src="my.js"></script>';

else

include default code

The code for each needs to be like this, and the advertiser id will change based on the hour, and the JS will be included with each code as well.

I will need one else for every hour of the day, so 24 of them.

I've written this before, I just can't find it so I know it's pretty quick and easy to do.

Skills: PHP, SQL

See more: find php, sql based, script ads, rules, js script, php sql code, sql final, script src, php script sql, php script server, php change code easy, find advertiser, php script echo, written script, script switches, simple mock, echo script php, sql select script, echo script, src php, mock code, quick php javascript, php echo script, javascript simple ads, easy find script

About the Employer:
( 9 reviews ) Austin, United States

Project ID: #563236

Awarded to:

neanton

Done. Please see PM

$30 USD in 0 days
(84 Reviews)
5.9

4 freelancers are bidding on average $43 for this job

ranacseruet

Ready to do it..

$30 USD in 1 day
(39 Reviews)
5.9
samyphp

i can do this work. see PM

$80 USD in 1 day
(1 Review)
3.0
smg0000

Completed and optimized the code (3 lines).

$30 USD in 0 days
(0 Reviews)
0.0