help spot the error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
SidewinderX
Forum Contributor
Posts: 407
Joined: Fri Jul 16, 2004 9:04 pm
Location: NY

help spot the error

Post by SidewinderX »

my code for the most part works but every time it runs it adds two of the same values to the database. It adds 80 different values, then after that 80 it duplicates the same 80 for a total of 120. Here is my code (its pretty messy)


The first time the script runs it parses 80 values and uploads 40 of those values into the database, then the same code is reiterated and a different 40 values are added. (but for some reason the script is executed twice.) Its probabley an error with the sepreate functions (as i didnt design that part and im use to just one big jumbble of code)

So any input is appreciated

Thanks in advanced
Last edited by SidewinderX on Thu Oct 13, 2005 3:06 pm, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

$j < 80
SidewinderX
Forum Contributor
Posts: 407
Joined: Fri Jul 16, 2004 9:04 pm
Location: NY

Post by SidewinderX »

bingo, that was it!
Thanks
SidewinderX
Forum Contributor
Posts: 407
Joined: Fri Jul 16, 2004 9:04 pm
Location: NY

Post by SidewinderX »

here is another one
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in d:\www3\PCID\pcid2.php on line 19
Last edited by SidewinderX on Thu Oct 13, 2005 3:07 pm, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

your call to mysql_query failed
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

cough cough

Code: Select all

$result = mysql_query() or die(mysql_error());
for more information
SidewinderX
Forum Contributor
Posts: 407
Joined: Fri Jul 16, 2004 9:04 pm
Location: NY

Post by SidewinderX »

this is the same query



and it works perfectley fine. Also

Code: Select all

$result = mysql_query() or die(mysql_error());
didnt add any more information
Post Reply