Jump to content

Recommended Posts

Ok, basicly my page looks like this (I wont use technical details). The problem is page refresh problem.

Note all syntax is example and may/is inccorect.

 

$infoq = mysql_query("SELECT * FROM XXX;", $lid);

$Table = "<table><tr>";

while($info = mysql_fetch_array($infoq)){

     $Table .= "<td>".$info['XXX']."</td>";

}

$Table .= "</tr></table>";

 

if ($_POST['do'] == 'SUBMIT'){

   if(mysql_query("INSERT INTO XXX (XXX) VALUES ($_POST['insertthis']);", $lid){

      $errorlist .= 'Successfully updated table';

   } else {

      $errorlist .= 'Unsuccessfully updated table'; 

   }

}

 

echo "Hi<br>".$Table."<br><input name=\"insertthis\" type=\"text\"><input type=\"submit\" name=\"do\" value=\"SUBMIT\">".$errorlist;

 

 

 

 

Now I can always just add a header refresh below the lines " $errorlist .= 'Successfully updated table';" and " $errorlist .= 'Unsuccessfully updated table';" BUT the problem with this (the problem i am faceing) is that this will refresh, and will refresh the table..

the problem is it discards the errorlist information.

So basicly, I want to refresh the page without discarding the log/errorlog information.

I do not want this, how can I get around this? I would like to avoid sessions and cookies if possible.

NOW I am presuming that moving the create table bit CANNOT be moved below the create table bit. Please dont tell me to move it below.

The mysql_fetch_array part of the code MUST stay before.

Im not overly good at explainging things, questions are fine, as to what I mean  :P

Thanks, Josh

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.