Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
sting
Involved
Involved



Joined: Sep 23, 2003
Posts: 456
Location: Somewhere out there...

PostPosted: Sun Dec 12, 2004 10:46 pm Reply with quote

Hi gang.

Have an admin module that I am working on that inserts data into a table. The basics of it are as follows:

The [software] program starts by giving a list of [event] programs and associated contacts tied to those events.

User selects a [event] program and a contact, clicks the button that adds the contact's id to a table that links the contact with the program - basically table has three fields, a unique id and two other id fields (contactid and programid).

The insert works great, I can see it from phpMyAdmin, but when I go back into the program, which lists all contacts in that table, it doesn't show up right away.

Is there a function I should be running to reset something in order for the sql that is called to be re-called after the insert? Or am I just stuck with a time delay?

I suppose I could be more vague if necessary. Wink

Thanks,
-sting
 
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Mon Dec 13, 2004 4:50 pm Reply with quote

Have you tried a delay loop? Something like
Code:
$max=20000;

for ($i=0;$i<$max;$i++) {
}
Adjust the max as needed. Your incling might be to use the sleep() function, and you could try it, but the sleep() function actually stops the whole script for the allotted time. So, if the insert hasn't actually taken place, you will still have the same issue. With this empty loop, MySQL continues its thing while you just slow down the post processing.
 
View user's profile Send private message
sting







PostPosted: Mon Dec 13, 2004 7:51 pm Reply with quote

Ok, weird one here.

I solved the issue, turns out it was code related.

I had a variable that called a
Code:
$db->sql_fetchrow
against a particular variable and then later on in the code ran a sql_fetch_row against the same variable. For whatever reason, when I took out the first one (as it was no longer necessary) the list started populating normally.

Even weirder, if there was only one person, nothing showed up. If there were 4 entries, 3 showed up.

Ah, the joy of being a newb again.

Thanks for the attempted assist Raven, twas mere shoddy code.

-sting
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©