SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Working on it... Contrid's Avatar
    Join Date
    Apr 2006
    Location
    Online
    Posts
    955
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    php mysql errors...please help

    I am having some problems finishing up this script. Maybe someone can help me to sort out small issues.

    This is the first error :

    Warning: mysql_result(): email not found in MySQL result index 7 in /home/virtual/site5/fst/var/www/html/emailscript/cronjob.php on line 22
    Let me show you what is on line 22 of that file :

    $email = mysql_result($result, $i, 'email');
    So basically I was taking values from the database and then using the PHP mail function to send emails out to those email addresses. The database is set up correctly, and there are already records in there.

    I wish I new why I am getting these errors. There are 4 more errors, but I am sure that they link to this one, so if I could sort this one out, then the script might work.

    Thank you all for your help. It is greatly appreciated.

  2. #2
    Working on it... Contrid's Avatar
    Join Date
    Apr 2006
    Location
    Online
    Posts
    955
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I made an awfully stupid mistake.

    I was using the same variable names in both the main file and the include file, and they were supposed to serve different purposes.

    Problem sorted.

    Thanks.

  3. #3
    SitePoint Wizard rctneil's Avatar
    Join Date
    Jun 2005
    Posts
    1,891
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had the same problem a few days ago where i had another database connection in an include file and they both used the same variable names. When i changed the variable names in one of them, it all worked!

    Thanks

    Neil


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
  •