Location: PHPKode > projects > MyDB > webide/ffsavsq.php
<?php
/*************************************************************
 * The MyDB librairy and applications are product of SQLFusion
 * It may be used and/or distributed under the terms of the Q Public
 * License (QPL) version 1.0, enclosed in the file licence.txt.
 ****************************************************************/
/** MyDB IDE Version 0.4    **/ 
/** Author Philippe Lewicki **/
 
    require("mydbconfig.inc.php");    

 if (isset($delete)) {
	$query = "delete from savedquery where idsavedquery='$idquery'" ; 
              $rsaveq = mysql_db_query($conx->db, $query, $idconx); 
 	  if ($rsaveq) {
		$urlgoto = $HTTP_REFERER;  
	    } else {
	              $message = "ERROR".$strErrorContact ; 
	              $urlgoto = "./ffmsgurlerror.php?messageerr=".urlencode($message) ;      
		} 
    }

	/* Save the query */
   if(isset($idquery)) {
        $query = "update savedquery set qname='$qname', query='$sql_query', qorder='$sql_order', qpos='$pos' where idsavedquery='$idquery'" ; 
        $rsaveq = mysql_db_query($conx->db, $query, $idconx); 
 	  if ($rsaveq) {
		$urlgoto = "$resultpage?sql_query=".urlencode(stripslashes($sql_query))."&sql_order=".urlencode(stripslashes($sql_order))."&pos=".$pos."&idqueri=".$idquery."&sq=update" ; 
	    } else {
	       $message = "ERROR".$strErrorContact ; 
	       $urlgoto = "./ffmsgurlerror.php?messageerr=".urlencode($message) ;      
		}
     } else {
    	  $query = "insert into savedquery values ('', '', '$qname', '$sql_query', '$sql_order', '$sql_pos') "; 
	      $rsaveq = mysql_db_query($conx->db, $query, $idconx); 
	   if ($rsaveq) {
		$urlgoto = $HTTP_REFERER; 
	    } else {
	       $message = "ERROR insert Query".$strErrorContact ; 
	       $urlgoto = "./ffmsgurlerror.php?messageerr=".urlencode($message) ;      
		}
        }
 
      header("Location: $urlgoto"); 
     
?>
Return current item: MyDB