Jump to content

fetching record from multipul tables and making domain expire alerts


shonir

Recommended Posts

im working a online php software for domain management system.

 

now below is all information for exactly what i can do

 

1) table

tbl_expiration_notice

 

all domains stores in this table with expiration date.

 

-------fields

id = 5

title = sarking.com

type = 3

expirytime = 1315797147

_________________

 

2) table

 

{tbl}noticetype

 

all domain notification type mean some domains only register with us and some domain have hosting also with us and some domains only hosted

 

1)hosting

2)domain

3)domain+hosting

 

-------fields

id = 3

title = domain+hosting

_______________________

 

3)table

{tbl}mailtemp

 

all notice type have multi templates like one domain is going expire client will received 3 email.

 

-------fields

id = 1

parentid = 3

days = 60

subject = domain expire notice

message = your domain will be expire soon

________________________

 

4)table

 

{tbl}noticelogs

 

in this table we will store all sent mail notice so next time we will not repeat email.

 

-------fields

id = 10

noticeid = 5

mailid = 1

___________________________

 

my code

 

 

$shonirresult = $sm->shonirqueryfnc("select en.*, nt.*, mt.*, nl.*, en.id as en_id, en.title as en_title, mt.id as mt_id from {tbl}expiration_notice en, {tbl}noticetype nt, {tbl}mailtemp mt, {tbl}noticelogs nl where en.type=nt.id and nt.id=mt.parentid and en.expirytime<($shonirvartime+(".(60*60*24)."*mt.d ays)) and (nl.noticeid<>en.id and nl.mailid<>mt.id ) ", 'Get Expiration Notice Result');

$shonirrows = $sm->shonirrowsfnc($shonirresult, 'Get Expiration Notice Rows');

if($shonirrows>0){

$shonirrecords = $sm->shonirrecordsfnc($shonirresult, 'Get Expiration Notice Records');

 

echo date("m/d/Y", ($shonirvartime)).'<br/>' ;

 

echo $shonirrecords['en_title'].'<br/>';

 

$sm->shonirqueryfnc("insert into {tbl}noticelogs (noticeid, mailid, addtime) value({$shonirrecords['en_id']}, {$shonirrecords['mt_id']}, $shonirvartime) ", 'Insert Notice Log Record');

 

}

 

 

problems is function show sarking.com again even i add there function if not exit in noicelog table then show.

 

(nl.noticeid<>en.id and nl.mailid<>mt.id )

 

i dont know why its not working :'(

 

 

thanks in advance for your consideration

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.