mysql input/output

Tags:    php

Jeg har flg. kode:

<pre>
<quote>



mysql_connect("localhost","Thomas","670067");
mysql_select_db("test");
if($sendz == "OK")
{
if($chkuz="#AutoPilot")
{
$query = mysql_query("select * from PCA where word2PCA like '%$mes'");
$number = mysql_num_rows($query);
echo ("Din søgning på: <b>$mes</b> gav $number resultat(er):<p>");
echo (mysql_error());
if ($number==0)
{
$mesg="I cant understand you please try again on the folowing language(s): English";
$Sesg=time();
$Userg="#AutoPilot";
$Pasg="#NON-*";
$Titleg="AutoPilot";
mysql_query("INSERT INTO chkcha (Msg,Ses,User,Pas,Title) VALUES ($mesg,$Sesg,$Userg,$Pasg,$Titleg)");

$query = mysql_query("select id,Msg,Ses,User,Title from chkcha order by Ses DESC LIMIT 0,8888");
$number = mysql_num_rows($query);
while($data = mysql_fetch_array($query)){
$Sa=$Sa & $data[$msg] & "\\n";
echo("<textarea cols='50' rows='20' name='mes' wrap='physical'>$Sa</textarea><br><br>");
}
}
else
{

while ($r = mysql_fetch_array($query))
{
extract($r);
$mesg=$PCA2Uz;
$Sesg=time();
$Userg="#AutoPilot";
$Pasg="#NON-*";
$Titleg="AutoPilot";
mysql_query("insert into chkcha (Msg,Ses,User,Pas,Title) values ('$mesg','$Sesg','$Userg','$Pasg','$Titleg')");

$query = mysql_query("select * from chkcha order by Ses DESC LIMIT 0,8888");
$number = mysql_num_rows($query);
while($data = mysql_fetch_array($query)){
$Sa=$Sa & $data[$msg] & "\\n";
echo("<textarea cols='50' rows='20' name='mes' wrap='physical'>$Sa</textarea><br><br>");
}


}
}
}
else
{
$mesg=$mes;
$Sesg=time();
$Userg=$Userh;
$Pasg=$UpasH;
$Titleg=$UtileH;
mysql_query("insert into chkcha (Msg,Ses,User,Pas,Title) values ('$mesg','$Sesg','$Userg','$Pasg','$Titleg')");

$query = mysql_query("select * from chkcha order by Ses DESC LIMIT 0,8888");
$number = mysql_num_rows($query);
while($data = mysql_fetch_array($foresp)){
$Sa=$Sa & $data[$msg] & "\\n";
echo("<textarea cols='50' rows='20' name='mes' wrap='physical'>$Sa</textarea><br><br>");
}
}

}
else
{
$query = mysql_query("select id,Msg,Ses,User,Title from chkcha order by Ses DESC LIMIT 0,8888");
$number = mysql_num_rows($query);
while($data = mysql_fetch_array($query)){
$Sa=$Sa & $data[$Msg] & "\\n";
echo("<textarea cols='50' rows='20' name='mes' wrap='physical'>$Sa</textarea><br><br>");
}
}


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Nyt dokument</title>
<meta name="generator" content="TSW WebCoder">
</head>

<body>
<form name="PolComChat" method="POST" action="chk.php">
<input type="hidden" name="sendz" value="OK">
<input type="text" name="mes" size="50"><input type="submit" name="send" value="Send"><br><br>
<select name="chkuz" class="input"><p></p>


mysql_connect("localhost","Thomas","670067");
mysql_select_db("test");

$qry = mysql_query("select * from chkusers");
while ($row = mysql_fetch_array($qry)){
echo (mysql_error());
$id = $row["id"];
$chkus = $row["chkUserName"];
echo ("<option value=\\"$id\\">$chkus</option>");
echo (mysql_error());
}


</select>

</form>


</body>
</html>

</quote>
</pre>
det ville ikke tilføje det er er skrevet til databsen og den ville hllerik tag det der er i databsen ud!

msg består er af typen tekst og fuldtekst

den udskriver bare 0 også elv om der er en medelse i databsen!

hvorfor?

håber nogen kan hjælpe!

TAK!

mvh.
Thomas Christensen
;-)




t