why do I run this paragraph of unable code Write Data enter a data base?
lima-city → Forum → Programmiersprachen → PHP, MySQL & .htaccess
-
<html>
<body>
<?
if ($UserName)
{
mysql_connect("localhost","root","xxxx") or die (" Problem connecting to DataBase");
$query = "insert into tbl values ('$idx','$UserName','$LastName','$FreeText')";
$result = mysql_db_query("example", $query);
echo "Data inserted. new table:<br><p></p>";
$query = "SELECT * FROM tbl";
$result = mysql_db_query("example", $query);
if ($result)
{
echo "<table width=90% align=center border=1><tr>
<td align=center bgcolor=#00FFFF>idx</td>
<td align=center bgcolor=#00FFFF>User Name</td>
<td align=center bgcolor=#00FFFF>Last Name</td>
<td align=center bgcolor=#00FFFF>Free Text</td>
</tr>";
while ($r = mysql_fetch_array($result))
{
$idx = $r["idx"];
$user = $r["UserName"];
$last = $r["LastName"];
$free = $r["FreeText"];
echo "<tr>
<td>$idx</td>
<td>$user</td>
<td>$last</td>
<td>$free</td>
</tr>";
} // while circulation be over
echo "</table>";
}
else
{
echo "No data.";
} // if Be over($result)
}
else
{
echo "No UserName Entered. Please go back and reenter UserName";
} // if Be over($UserName)
echo "<p></p>";
include ('links.x');
?>
</body>
</html>
-
Diskutiere mit und stelle Fragen: Jetzt kostenlos anmelden!
lima-city: Gratis werbefreier Webspace für deine eigene Homepage
-
Diskutiere mit und stelle Fragen: Jetzt kostenlos anmelden!
lima-city: Gratis werbefreier Webspace für deine eigene Homepage