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.repository' doesn't exist
the first one of the php, that I soud use for makeing the text is..
<!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">Titel:</label>
<input type="text" name="title" id="title"<? if(isset($_POST['title'])) echo " value=\"".$_POST['title']."\"";?> />
</p>
<p>
<label for="content">Indhold:</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ælg lyd" />
</p>
</form>
</body>
</html>
And the 2'nd one is were I soud upload the au.file sound..
<?
require("database.inc.php");
{connectDatabase();}
?><!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æ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ælg lyd</h1>
<h3 style="color:#CC3333">Pas på! Der findes allerede et diktat med denne titel.<br />
Hvis du er ved at lave et nyt diktat, burde du gå <a href="javascript:history.back()">tilbage</a> og vælge en anden titel.
Gør du ikke det, bliver diktatet med titelen "<?=$_POST['title']?>" erstattet med dette diktat her!</h3>
<?
}
?>
<form enctype="multipart/form-data" action="save_dict.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="500000" />
<table border="0">
<?
$query = "SELECT word FROM repository";
$result = mysql_query($query) or die("Query failed ($query): " . mysql_error());
$word_start=0;
$word_stop=0;
$open=false;
$words=array();
$content=$_POST['content'];
for($i=0;$i<strlen($content);$i++) {
if(substr($content,$i,1)=="<" && !$open) {
$word_start=$i+1;
$open=true;
}
elseif(substr($content,$i,1)==">" && $open) {
$word_stop=$i;
$word=substr($content,$word_start,$word_stop-$word_start);
if(!in_array($word,$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(";",$words); ?>" />
<input type="hidden" name="content" value="<?=$_POST['content']?>" />
<input type="hidden" name="title" value="<?=$_POST['title']?>" />
<input type="submit" value="Upload & save" />
</form>
</body>
</html>
I hope that you can see what the table is. and that you will help me creating it....
Thanks..