sql query to extract

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    sql query to extract

    Hi, in my database were imported these tables, this is my mission impossible, LoL
    PHP Code:
    -- --------------------------------------------------------
    --
    -- 
    Table structure for table `ibwf_chonline`
    --
    CREATE TABLE `ibwf_chonline` (
      `
    lton` int(15) NOT NULL default '0',
      `
    uid` int(100) NOT NULL default '0',
      `
    rid` int(99) NOT NULL default '0',
      
    PRIMARY KEY  (`lton`),
      
    UNIQUE KEY `username` (`uid`)
    ) 
    ENGINE=MyISAM DEFAULT CHARSET=latin1;
    --
    -- 
    Dumping data for table `ibwf_chonline`
    --
    -------------------------------------------------------------------------------------------------- 
    -- 
    -- 
    Table structure for table `ibwf_chat` 
    -- 
    CREATE TABLE `ibwf_chat` ( 
      `
    id` int(99) NOT NULL auto_increment, 
      `
    chatter` int(100) NOT NULL default '0', 
      `
    who` int(100) NOT NULL default '0', 
      `
    timesent` int(50) NOT NULL default '0', 
      `
    msgtext` varchar(255) NOT NULL default '', 
      `
    rid` int(99) NOT NULL default '0', 
      `
    exposed` char(1) NOT NULL default '0', 
      
    PRIMARY KEY  (`id`) 
    ) 
    ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; 
    -- 
    -- 
    Dumping data for table `ibwf_chat` 
    -- 
    ------------------------------------------------------------------- 
    -- 
    -- 
    Table structure for table `ibwf_clubs` 
    -- 
    CREATE TABLE `ibwf_clubs` ( 
      `
    id` int(100) NOT NULL auto_increment, 
      `
    owner` int(100) NOT NULL default '0', 
      `
    name` varchar(30) NOT NULL default '', 
      `
    description` varchar(200) NOT NULL default '', 
      `
    rules` blob NOT NULL, 
      `
    logo` varchar(200) NOT NULL default '', 
      `
    plusses` int(100) NOT NULL default '0', 
      `
    created` int(100) NOT NULL default '0', 
      
    PRIMARY KEY  (`id`) 
    ) 
    ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; 
    -- 
    -- 
    Dumping data for table `ibwf_clubs` 
    -- 
    -- -------------------------------------------------------- 
    -- 
    -- 
    Table structure for table `ibwf_settings` 
    -- 
    CREATE TABLE `ibwf_settings` ( 
      `
    id` int(10) NOT NULL auto_increment, 
      `
    name` varchar(30) NOT NULL default '', 
      `
    value` text NOT NULL, 
      
    PRIMARY KEY  (`id`), 
      
    UNIQUE KEY `name` (`name`) 
    ) 
    ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ; 
    -- 
    -- 
    Dumping data for table `ibwf_settings` 
    -- 
     
    INSERT INTO `ibwf_settings` VALUES(3, '4ummsg', ''); 
    Table ibwf_chat I have to add the logo of the table ibwf_clubs, and the text message
    INSERT INTO `ibwf_settings` VALUES (3, ummsg '4 ',''); ibwf_settings the table. then I need to extract the query from sql and place in file chat.php (I need when I create a private room.) anyone has any idea of how you can make a query?
    Last edited by Leviathan73; 14.03.11, 17:07.

    #2
    this code in the image is out of the room
    PHP Code:
     $rooms = mysql_query("SELECT id, name, pass, pic FROM ibwf_rooms WHERE static='0'"); 
            
    $co=0; 
            while (
    $room= mysql_fetch_array($rooms)) 
            { 
    $ilink = trim($room[3]); 
      if(
    $ilink=="") 
      { 
       
    $ilink = "<img src=\"default_image.gif\" alt=\"*\"/>"; 
      }else{ 
       
    $ilink = "<img src=\"$ilink\" alt=\"*\"/>"; 
      } 
                
    $co++; 
              if(
    canenter($room[0], $sid)) 
              { 
                
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE rid='".$room[0]."'")); 
                if(
    $room[2]=="") 
                { 
                  echo 
    "$ilink <a href=\"chat.php?&amp;rid=$room[0]&amp;sid=$sid\">".htmlspecialchars($room[1])."($noi[0])</a><br/>"; 
                }else{ 
                  echo 
    htmlspecialchars($room[1]); 
                  echo 
    "$ilink <form action=\"chat.php\" method=\"get\">"; 
                  echo 
    "<br/><input format=\"*x\" name=\"rpw\" maxlength=\"10\"/><br/>"; 
                  echo 
    "<input type=\"submit\" value=\"GO\"/>"; 
                  echo 
    "<input type=\"hidden\" name=\"rid\" value=\"$room[0]\"/>"; 
                  echo 
    "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>"; 
                  echo 
    "</form>"; 
     
                } 
              } 
            } 
    PHP Code:
    echo "<form action=\"genproc.php?action=mkroom&amp;sid=$sid\" method=\"post\">"; 
        echo 
    "Room Name: <input name=\"rname\" maxlength=\"30\"><br/>"; 
        echo 
    "Password: <input name=\"rpass\" style=\"-wap-input-format: '*x'\" maxlength=\"10\"><br/>"; 
        echo 
    "Pic Url: <input name=\"pic\" maxlength=\"255\" value=\"http://\"/><br/>"; 
        echo 
    "<input type=\"Submit\" name=\"Create\" Value=\"Create\"></form>"; 
    PHP Code:
    $pic = mysql_escape_string($_POST["pic"]); 
    $pic = htmlspecialchars($pic); 
            
    $res = mysql_query("INSERT INTO ibwf_rooms SET name='".$rname."', pass='".$rpass."', censord='".$cns."', static='0', lastmsg='".time()."', pic='".$pic."'"); 
    Need query please

    Comment

    Working...
    X