Jump to content

mark107

Members
  • Content Count

    94
  • Joined

  • Last visited

Everything posted by mark107

  1. Code for array: $searchemail = '%' . 'gmail.com' . '%'; $searchsubject = '%' . 'gmail.com' . '%'; $searchmessage = '%' . 'gmail.com' . '%'; $mailbox = $link->prepare("SHOW TABLES"); $mailbox->execute(); $email_arr = array(); $folders = array(); $total_results = 0; $i = 0; while ($folder = $mailbox->fetch(PDO::FETCH_NUM)) { $folder = $folder[0]; //if (strpos($folder, 'trash') !== false) { //$folder = str_replace('trash', '', $folder); //} if (strpos($folder, 'users') !== false) { $folder = str_replace('users', '', $folder); } e
  2. here is the results for the array when I am on the page 1: Image body........................1 Hey........................2 Hey........................3 Testing........................4 Re: Re: This weekend........................5 Re: This weekend........................6 This weekend........................7 Hey........................8 Meeting this weekend........................9 Meeting this weekend........................10 Re: Working on a project........................11 Hey Mark 7........................12 Hey Mark 6........................13 Hey Mark 5......................
  3. I find it very strange because when I store the list of strings in the array and when I use: $test = array_slice($email_arr, 50, 50); It works fine, but when I try this: $search_mailbox = $link->prepare("SELECT * FROM $folder WHERE from_email LIKE ? OR subject LIKE ? OR message LIKE ? ORDER BY received_date DESC LIMIT 50, 50"); I will not be able to see the same output as above. Any idea?
  4. Thanks, but it will do nothing as it will display more than 50 rows.
  5. What value do you want me to reset before each folder?
  6. Yes, I am getting more than 50 per folder. So I want to display 50 total per page.
  7. Im sorry but it is still not resolve as I have been checking on my keywords. I'm still getting more than 50 rows in per page so I dont know what to do and how to resolve it. Do I have to use something is like the arrays or something like that if it would help or not? If it would not help then what I need to do?
  8. Already done it. It is a shame that no one could help me to solve it when I have to find my own way to solve it.
  9. I have tried it but it doesn't work. Because of this I am using each folder under the loop so there is no way to avoid it unless I have to use one table or store the list of strings in the array or something like that.
  10. There is no syntax error. So what you mean for the folder thing that's not really good? I can see the full output for the email subjects. I cant be able to limit it to 50 when I'm searching for each folder. If I search one folder it will works fine, so I want to search for all folders. Any idea how I can be able to limit it to allow me to display them in page 1, page 2 and so on?
  11. Hi all, I need your help as I have got a problem with display the 50 rows in the search results. I want to limit 50 rows in per page and if I have less than 50 rows like 21 rows in the page 2 then display the 21 rows. I have got a problem with the limit, because when I tried to use `LIMIT 0, 50`, it will display total 71 rows which I only want to display no more than 50 in per page. Here is what I have tried: $search_mailbox = $link->prepare("SELECT * FROM $folder WHERE from_email LIKE ? OR subject LIKE ? OR message LIKE ? ORDER BY received_date DESC LIMIT 0, 50");
  12. Hi all, I need some help with my code as I've a trouble with sending the emails with images attachments. I'm using Pear Mail library to send the emails so when I send the emails with attachments to gmail, I am unable to see the attached images in my gmail inbox as there is no images show on the bottom of the subject unless when I open on my email so I can see the images attachments. And I am unable to see the images on yahoo when i sent the emails, so I sent a test email on my webmail with the images as attachments and I can see the images on gmail and yahoo with no problem. I think there
  13. Thank you very much for this as it is working great. Problem are now resolved.
  14. I dont store these strings seperate. I stored altogether. See this for yourself !
  15. It doesn't make sense. I have asked how to remove the string and get the filename. I have tried this and it doesn't work. foreach ($attached_files_name as $filename) { if(strpos($filename, 'attid: ' . $attach_id) !== false) { $filename = str_replace('attid: ' . $attach_id, '', $filename); } if(strpos($filename, ' attid: ' . $attach_id . ' ') !== false) { $filename = str_replace(' attid: ' . $attach_id . ' ', '', $filename); } echo $filename; echo "<Br>"; }
  16. Why do I need to do that as I have already fetching the data and store in the array? I want to split the string for value like "0 filename: ", "1 filename: ", "2 filename: ", "3 filename: " or whatever it is to replace with empty string.
  17. Hi all, I am working on the PHP to fetch the data from the database. I would like to fetch the filename only following by: email1.png email2.png email3.png my_inbox.png When I try this: $mailbox_sql = 'SELECT * FROM ' . $mailfolder . ' WHERE email_id = ? AND message_id = ?'; $mailbox = $link->prepare($mailbox_sql); $mailbox->execute([$id,$message_id]); // set the resulting array to associative $row = $mailbox->fetch(PDO::FETCH_ASSOC); if (is_array($row)) { $attached = $row['attached_files']; $attached_files_name = explode('attid: ', $attached
  18. I cant remove the "185.220.101.46" because it come with it when i'm getting access to the site which i am not allowed to post it. So what I have to do then? Create a foreach loop to fetch the values and store in the array?
  19. I have tried this: echo $data->data['185.220.101.46']->appears; it doesn't work. Any idea? It would be easier if you could post the code of what i should use.
  20. T Thanks for your advice, I have removed it but I cant get the value of `appears` from the array as I am getting the same error. Any idea?
  21. Hi all, I need some help with my code as I have a hard time with fetching the value from the stdclass. I am using json data to convert it to PHP so I would like to fetch the "appears" data from the stdclass object. When I try this: echo $data->appears; I'm getting this: Notice: Trying to get property of non-object in /home/username/public_html/foldername/script.php on line 22 I have also tried this: echo $data[0]->appears->value; And this: echo $data->appears[0]->value; I am still get the same error so I dont k
  22. Thank you, I can see it is working great thanks.
×
×
  • 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.