php/mysql table

  • ScottG
  • Proficient
  • Proficient
  • ScottG
  • Posts: 477

Post 3+ Months Ago

Try what I posted before but change both if statements to if($type == '1')
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • demonmaestro
  • Gold Member
  • Gold Member
  • User avatar
  • Posts: 679
  • Loc: Conroe, Texas

Post 3+ Months Ago

the data shows but not in its <div> tag
  • ScottG
  • Proficient
  • Proficient
  • ScottG
  • Posts: 477

Post 3+ Months Ago

Oops try if(!$type) or if($type == '0')
  • ScottG
  • Proficient
  • Proficient
  • ScottG
  • Posts: 477

Post 3+ Months Ago

Oops try if(!$type) or if($type == '0')
  • demonmaestro
  • Gold Member
  • Gold Member
  • User avatar
  • Posts: 679
  • Loc: Conroe, Texas

Post 3+ Months Ago

i did if($type == '0') and it worked BUT...

Image


//Edit: Fixed it with this.
Lines 245-247
Code: [ Select ]
    <tr valign="top">
      <?php echo build_row($table_keys, $table, '1'); ?>
    </tr>
  1.     <tr valign="top">
  2.       <?php echo build_row($table_keys, $table, '1'); ?>
  3.     </tr>
  • ScottG
  • Proficient
  • Proficient
  • ScottG
  • Posts: 477

Post 3+ Months Ago

On the td add the attribute valign="top"
  • demonmaestro
  • Gold Member
  • Gold Member
  • User avatar
  • Posts: 679
  • Loc: Conroe, Texas

Post 3+ Months Ago

I think that will about do it.
Unless i run into a bug.

Thank you ScottG and Bogey for all the help!

Also cannot forget to thank BigWebMaster for such a great place to get help.
  • demonmaestro
  • Gold Member
  • Gold Member
  • User avatar
  • Posts: 679
  • Loc: Conroe, Texas

Post 3+ Months Ago

One more thing. Why the wont this work.

Once done running the first query on the bits table i need it to update the BitTimes table. It WILL work if i use the <a href=url>mylink</a> command however it will not work when using the meta refresh.

well it will work but it will stop inputting the info for $from and $to. But when using the (a href) it will go in correctly.

Or is there a different way that ya would recommend me going about this?

Image

The id 7 is with the link and the id 8 is with the meta refresh.

PHP Code: [ Select ]
/*change Bit Status Need to order*/
     if(isset($_POST['SubUpdateStatusNeedToOrder'])){
      $serial = $_POST['serial'];
      $status = $_POST['status'];
      $from = $_POST['fromstatus'];
         $q = "UPDATE bits SET status='$status' WHERE serial='$serial'";
         mysql_query($q,$con);
      echo "Bit $serial has been updated!<br>";
      echo "?upstatus=$serial&fromstatus=$from&tostatus=$status";
      echo "<br><a href='?upstatus=$serial&fromstatus=$from&tostatus=$status'>next</a>";
        echo "<meta http-equiv=refresh content=2;URL='?upstatus=$serial&fromstatus=$from&tostatus=$status'>";
     }
     if($_GET["upstatus"]){
        $serial = $_GET['upstatus'];
        $from = $_GET['fromstatus'];
        $to = $_GET['tostatus'];
        $q = "INSERT INTO BitTimes VALUES ('', '$serial', '$from', '$to', '$date')";
         mysql_query($q,$con);
         echo "Updating main order board";   
         echo "<meta http-equiv=refresh content=2;URL=orders.php>";
        }
 
  1. /*change Bit Status Need to order*/
  2.      if(isset($_POST['SubUpdateStatusNeedToOrder'])){
  3.       $serial = $_POST['serial'];
  4.       $status = $_POST['status'];
  5.       $from = $_POST['fromstatus'];
  6.          $q = "UPDATE bits SET status='$status' WHERE serial='$serial'";
  7.          mysql_query($q,$con);
  8.       echo "Bit $serial has been updated!<br>";
  9.       echo "?upstatus=$serial&fromstatus=$from&tostatus=$status";
  10.       echo "<br><a href='?upstatus=$serial&fromstatus=$from&tostatus=$status'>next</a>";
  11.         echo "<meta http-equiv=refresh content=2;URL='?upstatus=$serial&fromstatus=$from&tostatus=$status'>";
  12.      }
  13.      if($_GET["upstatus"]){
  14.         $serial = $_GET['upstatus'];
  15.         $from = $_GET['fromstatus'];
  16.         $to = $_GET['tostatus'];
  17.         $q = "INSERT INTO BitTimes VALUES ('', '$serial', '$from', '$to', '$date')";
  18.          mysql_query($q,$con);
  19.          echo "Updating main order board";   
  20.          echo "<meta http-equiv=refresh content=2;URL=orders.php>";
  21.         }
  22.  
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9090
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Are you saying the meta refresh won't redirect? If so I believe the meta refresh must be within your head section.
  • demonmaestro
  • Gold Member
  • Gold Member
  • User avatar
  • Posts: 679
  • Loc: Conroe, Texas

Post 3+ Months Ago

well its redirecting it but its not sending all the info with it like it will if use the actual link
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9090
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

I am not sure I am following exactly, but you have two different meta refreshes there in the code you posted above, and one only contains orders.php, is that what you mean by the actual link with no data? That would probably mean the code at the very bottom is the meta refresh that is being shown.
  • demonmaestro
  • Gold Member
  • Gold Member
  • User avatar
  • Posts: 679
  • Loc: Conroe, Texas

Post 3+ Months Ago

No, the inital scrypt SubUpdateStatusNeedToOrder will redirrect with this "?upstatus=$serial&fromstatus=$from&tostatus=$status'" and then go to upstatus then it will refresh to orders.php. its the only way that i can think of right now to run two INSERT INTO querys on the same command.
  • ScottG
  • Proficient
  • Proficient
  • ScottG
  • Posts: 477

Post 3+ Months Ago

Why not just run both queries and ditch the refreshes?

Something like This is untested but the concept is here;
PHP Code: [ Select ]
if(isset($_POST['SubUpdateStatusNeedToOrder'])){
   
    $serial = $_POST['serial'];
    $status = $_POST['status'];
    $from = $_POST['fromstatus'];
   
    $q1 = "UPDATE bits SET status='$status' WHERE serial='$serial'";
    $q2 = "INSERT INTO BitTimes VALUES ('', '$serial', '$from', '$status', '$date')";
   
    $result1 = mysql_query($q1);
    $result2 = mysql_query($q2);
   
    if (!$result1 || !$result2) {
        die('Invalid query: ' . mysql_error());
    } else {
        header("Location: orders.php");
    }
   
}
 
  1. if(isset($_POST['SubUpdateStatusNeedToOrder'])){
  2.    
  3.     $serial = $_POST['serial'];
  4.     $status = $_POST['status'];
  5.     $from = $_POST['fromstatus'];
  6.    
  7.     $q1 = "UPDATE bits SET status='$status' WHERE serial='$serial'";
  8.     $q2 = "INSERT INTO BitTimes VALUES ('', '$serial', '$from', '$status', '$date')";
  9.    
  10.     $result1 = mysql_query($q1);
  11.     $result2 = mysql_query($q2);
  12.    
  13.     if (!$result1 || !$result2) {
  14.         die('Invalid query: ' . mysql_error());
  15.     } else {
  16.         header("Location: orders.php");
  17.     }
  18.    
  19. }
  20.  
  • demonmaestro
  • Gold Member
  • Gold Member
  • User avatar
  • Posts: 679
  • Loc: Conroe, Texas

Post 3+ Months Ago

everytime i have tried to run 2 queries at once it no work. however that maybe work.

Post Information

  • Total Posts in this topic: 104 posts
  • Users browsing this forum: Liamw411 and 74 guests
  • 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 post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.