Jump to content
MakeWebGames

Recommended Posts

Posted

lol hahaha

mysql_query('INSERT INTO `events` VALUES()');

If you can post of the Table Structure for the event's table, ill be able to complete the rest. I have not looked at MCCode for over a year and a half, and can't be bothered for a simple query.

Posted

After

$i = $db->insert_id(); in register.php

Add

//Define $mail and $subject before hand with the message you'd like to send

$db->query('INSERT INTO `mail` ( `mail_to`, `mail_time`, `mail_subject`, `mail_text` ) VALUES ( '.$i.', UNIX_TIMESTAMP(), "'.$db->escape($subject).'", "'.$db->escape($mail).'")');

Done.

EDIT: Optionally alter the create user query to set the new_mail field to 1 or

$db->query('UPDATE `users` SET `new_mail` = 1 WHERE (`userid` = '.$i.')');
Posted

DJ would you not define the new message within the insert query or even set the default to 1 ;)

and why not just use the event_add() function?

Posted

DJ would you not define the new message within the insert query or even set the default to 1 ;)

and why not just use the event_add() function?

EDIT: Optionally alter the create user query to set the new_mail field to 1 or

Either would work those two were just examples, and I think it's because the event_add is for events rather than messages. :P

Posted
but wouldent an event be better, cos you joining is an event itself

That's entirely not my call, the topic poster asked for a welcome message so that's what I gave. :)

  • 3 weeks later...
Posted
After

$i = $db->insert_id(); in register.php

Add

//Define $mail and $subject before hand with the message you'd like to send

$db->query('INSERT INTO `mail` ( `mail_to`, `mail_time`, `mail_subject`, `mail_text` ) VALUES ( '.$i.', UNIX_TIMESTAMP(), "'.$db->escape($subject).'", "'.$db->escape($mail).'")');

Done.

EDIT: Optionally alter the create user query to set the new_mail field to 1 or

$db->query('UPDATE `users` SET `new_mail` = 1 WHERE (`userid` = '.$i.')');

 

So I would put

$db->query('INSERT INTO `mail` ( `mail_to`, `mail_time`, `mail_subject`, `mail_text` ) VALUES ( '.$i.', UNIX_TIMESTAMP(), "'.$db->escape(Welcome).'", "'.$db->escape(Hello Welcome to the game.'")');
Posted

Above the insert simple define the two variables like such

$subject = "Welcome to MYGAME!";
$mail = "Some really long message right here...";
Posted
Ahh okay and How would one get it so It would come from Id 2 Not id 1?
$db->query('INSERT INTO `mail` ( `mail_to`, `mail_from`, `mail_time`, `mail_subject`, `mail_text` ) VALUES ( '.$i.', 2, UNIX_TIMESTAMP(), "'.$db->escape($subject).'", "'.$db->escape($mail).'")');

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.   Paste as plain text instead

  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...