Professional Web Applications Themes

what is wrong here? - PHP Development

hi, i was wondering wat is wrong in this little code below??? <?php $verifyemail = $_GET['verify']; $checkemail = "SELECT verified FROM users WHERE (email = '$verifyemail')"; $emailresult = mysql_query ($checkemail); if (mysql_num_rows('$emailresult') != 1) die('We have not found you in our database'); // <=== line 114 $checkverify = "UPDATE users SET verified = 'yes' WHERE (email = '$verifyemail')"; mysql_query ($checkverify); ?> when i run this i get this error Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/virtual/site755/fst/var/www/html/verify.php on line 114 i don't get it i checkt it trough the next problem is that wen i ...

  1. #1

    Default what is wrong here?

    hi,

    i was wondering wat is wrong in this little code below???


    <?php
    $verifyemail = $_GET['verify'];
    $checkemail = "SELECT verified FROM users WHERE (email =
    '$verifyemail')";
    $emailresult = mysql_query ($checkemail);
    if (mysql_num_rows('$emailresult') != 1) die('We have not found you in
    our database'); // <=== line 114
    $checkverify = "UPDATE users SET verified = 'yes' WHERE (email =
    '$verifyemail')";
    mysql_query ($checkverify);
    ?>

    when i run this i get this error

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
    resource in /home/virtual/site755/fst/var/www/html/verify.php on line 114

    i don't get it i checkt it trough


    the next problem is that wen i quote the line 114 out because i'm sure that
    the row is in the database (it's just a check) the update doesnt change the
    value in the database from 'no' to 'yes'

    thanks for your help


    The Lone Wolf Guest

  2. #2

    Default What is wrong here?

    Hi, friends,

    I have a function which send email with attachments as the follows:

    public int SendEmailWithAttachment(string fromEmailAddress,
    string toEmailAddress, string subject, string message, string attachment)
    {
    System.Web.Mail.MailMessage mm = new System.Web.Mail.MailMessage();
    mm.From = fromEmailAddress;
    mm.To = toEmailAddress;
    mm.Subject = subject;
    mm.Body = message;
    mm.BodyFormat = System.Web.Mail.MailFormat.Text;
    mm.Priority = System.Web.Mail.MailPriority.Normal;
    mm.BodyEncoding = System.Text.Encoding.Default;
    mm.UrlContentBase = "";
    mm.UrlContentLocation = "";

    if (attachment.Trim() != "")
    {
    char[] delim = new char[] {','};
    foreach (string sSubstr in attachment.Split(delim))
    {
    System.Web.Mail.MailAttachment ma = new
    System.Web.Mail.MailAttachment(sSubstr);
    mm.Attachments.Add(ma);
    }
    }

    System.Web.Mail.SmtpMail.SmtpServer = ""; //default
    System.Web.Mail.SmtpMail.Send(mm);
    return 1;
    }

    It works fine if there is only one attachment file. However, if there are
    two or more files, I got an error saying:
    Could not access 'CDO.Message' object.

    But, I really could not find what was wrong. Any ideas, suggestions, etc.?
    Thanks a lot.


    Andrew Guest

Similar Threads

  1. what is wrong
    By SLext in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 0
    Last Post: July 21st, 09:37 AM
  2. What am I doing wrong?
    By Aaron Bertrand - MVP in forum ASP Database
    Replies: 34
    Last Post: January 23rd, 11:01 PM
  3. What am I doing wrong???!?!
    By bfinelsen in forum Coldfusion Database Access
    Replies: 2
    Last Post: June 30th, 03:24 PM
  4. What's wrong...
    By Philippe Robert in forum PHP Development
    Replies: 5
    Last Post: November 18th, 10:16 AM
  5. [PHP] What is wrong??????
    By David Nicholson in forum PHP Development
    Replies: 1
    Last Post: July 14th, 07:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139