Em Andamento

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.

Habilidades: PHP, SQL

Ver mais: 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

Acerca do Empregador:
( 9 comentários ) Austin, United States

ID do Projeto: #563236

Premiar a:

neanton

Done. Please see PM

$30 USD em 0 dias
(84 Avaliações)
5.9

4 freelancers estão ofertando em média $43 para este trabalho

ranacseruet

Ready to do it..

$30 USD em 1 dia
(39 Comentários)
5.9
samyphp

i can do this work. see PM

$80 USD em 1 dia
(1 Comentário)
3.0
smg0000

Completed and optimized the code (3 lines).

$30 USD in 0 dias
(0 Comentários)
0.0