Jump to content

Recommended Posts

I have 4 strings in MySQL db1

 

$string1 : Hello

$string2 : Hi

$string3 : Great

$string4 : Thanks

 

And I have 3 accounts MySQL db2

 

$User1 : $Pw1

$User2 : $Pw2

$User3 : $Pw3

 

expected result

---------------

Hello goes to user1

Hi goes to user2

Great goes to user3  // all the users have been sent a message, so iterator should go to user 1 again

Thanks goes to user1

 

Any code snippet please....THANKS :)

Link to comment
https://forums.phpfreaks.com/topic/178825-alternate-messaging/
Share on other sites

you will have to associate the two tables in some way.

 

IMO the best would be in MySQL by adding another field to the db2 referencing the id of the greeting in db1. This is the most dynamic way since then all you need to do to add another greeting is to add it to db1 and update db2 new field with the id.

 

the you would pull the info in a join statement.

 

 

 

 

 

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/178825-alternate-messaging/#findComment-943401
Share on other sites

I have a db

 

Table1 contains these String messages

Table2 contains these Users

 

I need to write a test.php where you can help me with code snippet.

 

expected result

---------------

string1 to user1

string2 to user2

string3 to user3

string4 to user1

string5 to user2

 

Now what should be my code in test.php to send these alternating users with the data I have in another table??

Link to comment
https://forums.phpfreaks.com/topic/178825-alternate-messaging/#findComment-943644
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.