473,782 Members | 2,664 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A loop question?

Having more problems with updating contacts. For all that responded to
my previous problem THANKS. I accidentally deleted the posts so I
couldn't do it with a reply.

Anyhoo...

When I send an email to an individual (for example) I include this in my
mail script:

$sql = "INSERT into player_contact values ('', '$player_id', '$_POST
[cont_type]', '$_POST[cont_date]', '$_POST[cont_desc]')";
$result = @mysql_query($s ql, $connection) or die(mysql_error ());
//The primary and auto-increment key is the first value, then player_id
of the individual, contact type, contact date, contact description

However, if I send an email to my entire team (each having a player_id)
I can't get it to insert a contact record for each. This is a problem
with a team of over 100 football players as it takes forever to update
each player individually.

Thanks for any help. If anyone is interested I'm trying to put together
a team/recruiting database. I always wonder what people are building
when I read these posts, so I thought I'd throw that in.
Jul 17 '05 #1
1 1903
Hi,

I am not sure what you are doing, but I would not use $_post variables,
but that is just my personal view on the subject.

It seems that you are creating a record and sending a mail for 1 player
per page view - the exection of this page sending somthing via mail()...

I would transcode the variables into somthing more edible by MySQL, and
maybe echo these variables to your page before displaying them, as to
make sure that you are *really* inserting into your DB what you think
you are inserting...

I guess that your $_post[whatever] come from a previous web form... Have
you tried:

$qry = "INSERT INTO player_contact VALUES('', '$player_id',
'$cont_type', '$cont_date', '$cont_desc')";

mysql_query($qr y) or die("Could not execute the query");

or from your example, run an print:
print("INSERT into player_contact values ('', '$player_id',
'$_POST[cont_type]', '$_POST[cont_date]', '$_POST[cont_desc]')");

Cordially,

Daniel
Karzy wrote:
Having more problems with updating contacts. For all that responded to
my previous problem THANKS. I accidentally deleted the posts so I
couldn't do it with a reply.

Anyhoo...

When I send an email to an individual (for example) I include this in my
mail script:

$sql = "INSERT into player_contact values ('', '$player_id', '$_POST
[cont_type]', '$_POST[cont_date]', '$_POST[cont_desc]')";
$result = @mysql_query($s ql, $connection) or die(mysql_error ());
//The primary and auto-increment key is the first value, then player_id
of the individual, contact type, contact date, contact description

However, if I send an email to my entire team (each having a player_id)
I can't get it to insert a contact record for each. This is a problem
with a team of over 100 football players as it takes forever to update
each player individually.

Thanks for any help. If anyone is interested I'm trying to put together
a team/recruiting database. I always wonder what people are building
when I read these posts, so I thought I'd throw that in.


Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
3554
by: Arthur | last post by:
>>>a= >>> for p in a: print p 1 2 3 >>> p 3 My naive expectation was that p would be 'not defined' from outside
0
4354
by: John Wilson | last post by:
Hello, I have the following code which populates as table data from a SQL Server 2000 stored proc (RSByDemoID2). Below that is the view and stored procedure which takes @DemoID as input to match to the event_id. For Q? and Comments I am viewing/updating in a different table than I am question and how_to_answer. The stored proc is populated by a view that I'm using to get all these values from two tables. My quandry is, I am getting the...
3
7386
by: zeroDoNotYeSpamtype | last post by:
(I tried to post this earlier, but it seems without success) A similar question to this has been answered many times, to whit the question applying when the index variable of a for loop is declared in the loop header, but this time that isn't the case: I've got a piece of code a bit like this: #include <iostream> #include <cmath>
3
2672
by: Gustavo Randich | last post by:
The following seems to be a bug. The execution returns rows 1,2. It should return 1,1. In fact, if I run the code within a stored procedure alone (not in a trigger), the loop doesn't overwrite the value of y (works well). create table test (a integer) @ create table debug1 (a integer) @ create trigger test_1 after insert on test referencing new as ins for
22
2230
by: Jan Richter | last post by:
Hi there, the Code below shows DJBs own implementation of strlen (str_len): unsigned int str_len(char *s) { register char *t; t = s; for (;;) { if (!*t) return t - s; ++t;
8
7599
by: Shamrokk | last post by:
My application has a loop that needs to run every 2 seconds or so. To acomplish this I used... "Thread.Sleep(2000);" When I run the program it runs fine. Once I press the button that starts the looping function the window becomes unmovable and cannot close under its own direction (the upper right "close 'X'") My first attempt to solve the problem was to have the looping function execute as its own thread, the idea being this would...
29
5115
by: garyusenet | last post by:
I'm trying to investigate the maximum size of different variable types. I'm using INT as my starting variable for exploration. I know that the maximum number that the int variable can take is: 65,535. But i'm trying to write a program to test this, assuming I didn't know this number in advance. I came up with the following but have two questions. Maybe someone can help? using System; using System.Collections.Generic; using System.Text;
3
1796
by: nina297 | last post by:
Good morning, How do I set up a For each loop to loop through my records in the database? My fields are topics, question and answers. I want the one topic displayed that goes with each quesiton and answer. I'm using a data reader to get the data. Thanks.
44
4320
by: James Watt | last post by:
can anyone tell me how to do an infinite loop in C/C++, please ? this is not a homework question .
2
4855
by: perkykoala | last post by:
I apologize in advance for being REALLY detailed/verbose. It's the result of staring/tweaking code for too long. Using VB 2005: I need to design a multiple choice test (unfortunately, I can't use radio buttons). How it works... Pre-1) File consists of the following format: Question 1 Choice 1
0
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10308
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10076
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9939
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7486
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5375
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5507
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4040
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.