Jump to content

Need help to assign an array to a single value


janniesekind

Recommended Posts

hey everyone

 

will you please assist.

 

I'm getting data from a mysql database.

 

And I want to assign the data to a single value, if possible

 

For example, in my database I have 2 columns, name and group

 

Lets say John, Peter and Cathy belongs to group 555, where Sally and Marcus belongs to group 777.

 

So my sql query outputs all users in group 555

 

Is there a way to assign the search result to a vlue, for example $result = ???

 

and If I said echo $result, it should show the users who belongs to group 555 as an example.

 

I tried to use row[Name][1]; but it doesnt work.

 

The thing is, I can display the data the way I am familiar with, but I'm sending an automated email to myself, containing the users. So if I would used a for each statement, the mail will trigger and send a copy for every count, in this case, 3 times. And thats my huge problem.

 

The mail must trigger only once, containing the users in my search query, in this case, group 555.

 

Any help will be appreciated

 

Thank you

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.