Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Ezilon Directory   High Bandwidth Dedicated Servers   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 09-11-2004, 01:45 PM   #1 (permalink)
v7n Mentor
 
hatchet's Avatar
 
Join Date: 10-11-03
Posts: 1,149
iTrader: 0 / 0%
Latest Blog:
None

hatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nice
Infinite Loop

Code:
function emailcontractors($id) { $sql="SELECT * FROM projects WHERE id = '$id'"; //Get project info $result=mysql_query($sql) or DIE("Could not select database for emailing contractors"); $row=mysql_fetch_assoc($result); //Put project info into an array $sql2="SELECT * FROM tc_users WHERE (user_from = '$row[state]' OR user_state2 = '$row[state]' OR user_state3 = '$row[state]') && (user_trade = '$row[trade]' OR user_trade1 = '$row[trade]' OR user_trade2 = '$row[trade]' OR user_trade3 = '$row[trade]')"; $result2=mysql_query($sql2) or DIE("Could not select database for emailing contractors part 2"); if(mysql_num_rows($result2)) { while($row2=mysql_num_rows($result2)) { $contemail=$row2['user_email']; $contmsg="A new project has been submitted to Team Contractor that matches the criteria you have in your profile.\n The details are as follows:\n Contact Information\n"; $contmsg .= $row['contact']."\n"; $contmsg .= $row['ptype']."\n"; $contmsg .= $row['state']."\n"; $contmsg .= $row['city']."\n"; $contmsg .= $row['zip']."\n"; $subject="Team Contractor Project"; contractoremail($contemail, $contmsg, $subject);//send email to contractors } } else { $ownermsg="We apologize but there are no contractors matching your area or specific criteria.<br>The staff at Team Contractor will contact you within 2 days with information on your next course of action.<br>Regards,<br>Team Contractor Staff<br><br>Ref - id{$id}"; $owneremail=$row['email']; $subject='Team Contractor - No Contractors Available'; emailowner($owneremail, $ownermsg, $subject); } }
Essentially I'm trying to match up the 2 mysql fields ($row[state] and $row[trade] from sql) and compare that to 3 state fields and 4 trade fields in sql2. The initial $id in the function is output from an INSERT function with mysql_insert_id(); or last inserted id.
I ran this code and it sent about 10000 emails to me before John and Jazzee got it stopped (thanks btw).. but I'm just not seeing why it would do that. Been working on it too long I guess.
Any help greatly appreciated.
hatchet is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 09-11-2004, 04:45 PM   #2 (permalink)
v7n Mentor
 
hatchet's Avatar
 
Join Date: 10-11-03
Posts: 1,149
iTrader: 0 / 0%
Latest Blog:
None

hatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nice
Nevermind - I figured it out.
hatchet is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Loop Help, Please JohnRogers Coding Forum 1 01-21-2007 12:27 PM
Getting Back into the Loop IslaScotts Coding Forum 4 09-28-2006 01:05 PM
Loop Javascript Immo Coding Forum 5 09-20-2004 04:04 AM
Infinite Isolation greg Graphic Design Forum 14 03-12-2004 09:25 PM
Infinite Space 3 lombi Graphic Design Forum 4 03-03-2004 03:55 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 02:04 PM.
© Copyright 2008 V7 Inc