SQL query failed: "Table doesn't exist."

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kilo
    New Member
    • Jul 2007
    • 7

    SQL query failed: "Table doesn't exist."

    Hey.. I need someone hwo can help me making my sql table..
    I have no php skills. I have payed for a php program that shoud make dictation for people that have some problems reading danish.. with sound and text..
    When I'm making the dictation with PHP I'm getting an error like this.: Query failed (SELECT word FROM repository): Table 'test_dig_dk.re pository' doesn't exist

    the first one of the php, that I soud use for makeing the text is..

    [PHP]
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Nyt diktat</title>
    <link href="style.css " rel="stylesheet " type="text/css" />
    </head>

    <body>
    <h1 align="center"> Nyt diktat</h1>
    <form class="standard " action="select_ audio.php?mode= create" method="post">
    <p>
    <label for="title">Tit el:</label>
    <input type="text" name="title" id="title"<? if(isset($_POST['title'])) echo " value=\"".$_POS T['title']."\"";?> />
    </p>
    <p>
    <label for="content">I ndhold:</label><br />
    <textarea name="content" id="content" cols="100" rows="40"><? if(isset($_POST['title'])) echo implode("",file ("text/".$_POST['title'].".txt"));?> </textarea>
    </p>
    <p>
    <input type="submit" value="V&aelig; lg lyd" />
    </p>
    </form>
    </body>

    </html>
    [/PHP]



    And the 2'nd one is were I soud upload the au.file sound..

    [PHP]<?
    require("databa se.inc.php");
    {connectDatabas e();}
    ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>V&aelig; lg lyd til <?=$_POST['title']?></title>
    <link href="style.css " rel="stylesheet " type="text/css" />
    </head>

    <body>
    <? if(file_exists( "text/".$_POST['title'].".txt")) {
    ?>
    <h1>V&aelig;l g lyd</h1>
    <h3 style="color:#C C3333">Pas p&aring;! Der findes allerede et diktat med denne titel.<br />
    Hvis du er ved at lave et nyt diktat, burde du g&aring; <a href="javascrip t:history.back( )">tilbage</a> og v&aelig;lge en anden titel.
    G&oslash;r du ikke det, bliver diktatet med titelen &quot;<?=$_P OST['title']?>&quot; erstattet med dette diktat her!</h3>
    <?
    }
    ?>
    <form enctype="multip art/form-data" action="save_di ct.php" method="post">
    <input type="hidden" name="MAX_FILE_ SIZE" value="500000" />
    <table border="0">
    <?
    $query = "SELECT word FROM repository";
    $result = mysql_query($qu ery) or die("Query failed ($query): " . mysql_error());
    $word_start=0;
    $word_stop=0;
    $open=false;
    $words=array();
    $content=$_POST['content'];
    for($i=0;$i<str len($content);$ i++) {
    if(substr($cont ent,$i,1)=="<" && !$open) {
    $word_start=$i+ 1;
    $open=true;
    }
    elseif(substr($ content,$i,1)== ">" && $open) {
    $word_stop=$i;
    $word=substr($c ontent,$word_st art,$word_stop-$word_start);
    if(!in_array($w ord,$repository )) {
    $words[]=$word;
    ?>
    <tr>
    <td><?=$word? ></td>
    <td><input type="file" name="<?=$word? >" /></td>
    </tr>
    <?
    }
    $open=false;
    }
    }
    ?>
    </table>
    <input type="hidden" name="words" value="<? echo implode(";",$wo rds); ?>" />
    <input type="hidden" name="content" value="<?=$_POS T['content']?>" />
    <input type="hidden" name="title" value="<?=$_POS T['title']?>" />
    <input type="submit" value="Upload &amp; save" />
    </form>
    </body>
    </html>
    [/PHP]


    I hope that you can see what the table is. and that you will help me creating it....
    Thanks..
    Last edited by pbmods; Oct 13 '07, 06:47 PM. Reason: Removed excessive formatting so that people are less likely to ignore your post.
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, Kilo.

    Changed thread title to better describe the problem (did you know that threads whose titles do not follow the Posting Guidelines actually get FEWER responses?).

    In this function:
    [code=php]connectDatabase ();[/code]

    Are you mysql_select_db ()ing the correct database?

    Comment

    • kilo
      New Member
      • Jul 2007
      • 7

      #3
      I have the database inc.php were the database is connectet. all of the php make a requst to database.inc.ph p..
      And still tray to create a dicttation whithen this link of create.dict.php ..and i can't see what the missing table is..

      Database.inc.ph p
      [php]

      <?
      function connectDatabase () {
      $connect=mysql_ connect("localh ost","test_dig_ dk","password!! !");
      $select=mysql_s elect_db("test_ dig_dk",$connec t);
      if(!$connect || !$select)
      {
      ?>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <title>Fehler beim Verbinden mit der Datenbank</title>
      </head>
      <body>
      <p>Es ist beim Verbinden mit der Datenbank ein Fehler aufgetreten!</p>
      </body>
      </html>
      <?
      exit();
      }
      }
      ?>[/php]

      Comment

      Working...