Re: [PHP] Help with logic :(

2005-10-14 Thread Dan McCullough
Not a problem, good to see. On 10/14/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > NEVERMIND. > > Solved it. > > Thanks!!! > > A > > > Hi all, > > > > Just wondering how one would do multiple rows? > > > > Instead of me me copying and pasting the same row of code 15 times > > (multiple data e

Re: [PHP] Help with logic :(

2005-10-14 Thread aaronjw
NEVERMIND. Solved it. Thanks!!! A > Hi all, > > Just wondering how one would do multiple rows? > > Instead of me me copying and pasting the same row of code 15 times > (multiple data entry form), I just loop until it counts 15? > > Loops are not a strong point for me at all :( > > Thanks in adv

Re: [PHP] Help with logic :(

2005-10-14 Thread aaronjw
Hi all, Just wondering how one would do multiple rows? Instead of me me copying and pasting the same row of code 15 times (multiple data entry form), I just loop until it counts 15? Loops are not a strong point for me at all :( Thanks in advance!!! Aaron -- PHP General Mailing List (http://w

Re: [PHP] Help with logic :(

2005-10-11 Thread Dan McCullough
$result = mysql_query($query) or die(mysql_error()); On 10/11/05, Silvio Porcellana <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > > > include ("../utils.inc"); > > > > $date = date("U"); > > $dateExpire = $date + 90 * 86400; > > > > $code = "jack"; > > > >

Re: [PHP] Help with logic :(

2005-10-11 Thread John Nichel
[EMAIL PROTECTED] wrote: This SHOULD error out but I'm getting the error instead. It's just a test page to test my logic... A Check to see if there is an error first if ( ! $result = mysql_query ( $query ) ) { echo ( mysql_error() ); } -- John C. Nichel ÜberGeek KegWorks.com 7

RE: [PHP] Help with logic :(

2005-10-11 Thread aaronjw
r 11, 2005 1:34 PM >> To: Dan McCullough >> Cc: php-general@lists.php.net >> Subject: Re: [PHP] Help with logic :( >> >> > >> include ("../utils.inc"); >> >> $date = date("U"); >> $dateExpire = $date + 90 * 86400

Re: [PHP] Help with logic :(

2005-10-11 Thread Silvio Porcellana
[EMAIL PROTECTED] wrote: > > include ("../utils.inc"); > > $date = date("U"); > $dateExpire = $date + 90 * 86400; > > $code = "jack"; > > $query = "INSERT INTO CouponTable VALUES > ('','$date','0','$code','preset','$dateExpire','3.75')"; > > $result = mysql

RE: [PHP] Help with logic :(

2005-10-11 Thread Kilbride, James
Did you remember to open the database connection? > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Tuesday, October 11, 2005 1:34 PM > To: Dan McCullough > Cc: php-general@lists.php.net > Subject: Re: [PHP] Help with logic :( >

Re: [PHP] Help with logic :(

2005-10-11 Thread aaronjw
This SHOULD error out but I'm getting the error instead. It's just a test page to test my logic... A > got some code so we can see? > > On 10/11/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> Thanks everyone. Makes sense. Now I got another issue. >> >> When I try to see if an error exists

Re: [PHP] Help with logic :(

2005-10-11 Thread Dan McCullough
got some code so we can see? On 10/11/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Thanks everyone. Makes sense. Now I got another issue. > > When I try to see if an error exists I get this: > > Warning: mysql_error(): supplied argument is not a valid MySQL-Link > resource in /home//

Re: [PHP] Help with logic :(

2005-10-11 Thread aaronjw
Thanks everyone. Makes sense. Now I got another issue. When I try to see if an error exists I get this: Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /home//public_html/Store/test.php on line 14 Is there a setting somewhere that I need to set to make sur

Re: [PHP] Help with logic :(

2005-10-11 Thread Jochem Maas
Dan McCullough wrote: Yes I believe that is what Richard was saying about "Trap the INSERT error", you should get an error back from the database about having a problem with the insert instead of showing that error you will want to add some logic that when that error occurs you simply generate an

Re: [PHP] Help with logic :(

2005-10-11 Thread Dan McCullough
Yes I believe that is what Richard was saying about "Trap the INSERT error", you should get an error back from the database about having a problem with the insert instead of showing that error you will want to add some logic that when that error occurs you simply generate another number. On 10/11/

Re: [PHP] Help with logic :(

2005-10-11 Thread aaronjw
Hi Richard, Ok... I do already have a Unique index on the column but this process is something that I cannot echo out the error code to the user. The code is generated on the fly when an order an is placed so you can see... I can't echo out the error to the customer. Can I do an if statement IF a

Re: [PHP] Help with logic :(

2005-10-11 Thread Jochem Maas
Richard Lynch wrote: On Mon, October 10, 2005 3:24 pm, Dan McCullough wrote: create a function to check if the rndnumber=couponcode row count = 0 if not then redo rndnumber if it does = 0 then insert rndnumber N! You are creating a RACE CONDITION in which ONE use

Re: [PHP] Help with logic :(

2005-10-10 Thread Richard Lynch
On Mon, October 10, 2005 3:24 pm, Dan McCullough wrote: > create a function to check if the rndnumber=couponcode row count = 0 > if not then redo rndnumber if it does = 0 then insert rndnumber N! You are creating a RACE CONDITION in which ONE user might generate a 'val

Re: [PHP] Help with logic :(

2005-10-10 Thread Dan McCullough
create a function to check if the rndnumber=couponcode row count = 0 if not then redo rndnumber if it does = 0 then insert rndnumber On 10/10/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hey guys, > > Having trouble coming up with a solution to this idea I am trying to > implement. > > I hav

[PHP] Help with logic :(

2005-10-10 Thread aaronjw
Hey guys, Having trouble coming up with a solution to this idea I am trying to implement. I have a "Coupon" table. I am creating radonly generated coupon codes that go into this table. 12 chars in length - both number and letters - all lowercase. I figure I need to do the following: 1) generat