/ Forside / Teknologi / Udvikling / PHP / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
PHP
#NavnPoint
rfh 3959
natmaden 3372
poul_from 3310
funbreak 2700
stone47 2230
Jin2k 1960
Angband 1743
Bjerner 1249
refi 1185
10  Interkril.. 1146
hjælp php - mysql driller!
Fra : Ralle


Dato : 03-10-06 20:21

hejsa...

nogle der kan hjælpe??

får fejlen:

You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to
use near '' at line 1

min kode er:

<html>
<head>
<title>Upload File To MySQL Database</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<style type="text/css">
<!--
..box {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
border: 1px solid #000000;
}
-->
</style>
</head>

<body>
<?
if(isset($_POST['upload']))
{
   
$felta = $_POST['felt1'];
$feltb = $_POST['felt2'];
$feltc = $_POST['felt3'];
$feltd = $_POST['felt4'];
$felte = $_POST['felt5'];
$feltf = $_POST['felt6'];
$feltg = $_POST['felt7'];
$felth = $_POST['felt8'];
$felti = $_POST['felt9'];
$feltj = $_POST['felt10'];

$felteta = '<SCRIPT
language="JavaScript">alert('.$felta.')</SCRIPT>';
$feltetb = '<SCRIPT
language="JavaScript">alert("$feltb")</SCRIPT>';
$feltetc = '<SCRIPT
language="JavaScript">alert("$feltc")</SCRIPT>';
$feltetd = '<SCRIPT
language="JavaScript">alert("$feltd")</SCRIPT>';
$feltete = '<SCRIPT
language="JavaScript">alert("$felte")</SCRIPT>';
$feltetf = '<SCRIPT
language="JavaScript">alert("$feltf")</SCRIPT>';
$feltetg = '<SCRIPT
language="JavaScript">alert("$feltg")</SCRIPT>';
$felteth = '<SCRIPT
language="JavaScript">alert("$felth")</SCRIPT>';
$felteti = '<SCRIPT
language="JavaScript">alert("$felti")</SCRIPT>';
$feltetj = '<SCRIPT
language="JavaScript">alert("$feltj")</SCRIPT>';

$feltabcdefghij = "'$felteta $feltetb $feltetc $feltetd $feltete
$feltetf $feltetg $felteth $felteti $feltetj'";

   include 'config.php';
   include 'opendb.php';

   $query = "INSERT INTO test (felt ) ";
"VALUE ('$feltabcdefghij')";


   mysql_query($query) or die (mysql_error());
include 'closedb.php';
echo "<br>tingene er nu uploadede!<br>";
}
?>
<form action="" method="post" name="form">
<table width="350" border="0" cellpadding="1" cellspacing="1"
class="box">
<tr>
<td width="246"><input type="text"
name="felt1"><p></p><input type="text" name="felt2"><input
type="text" name="felt3"><input type="text" name="felt4"><input
type="text" name="felt5"><input type="text" name="felt6"><input
type="text" name="felt7"><input type="text" name="felt8"><input
type="text" name="felt9"><input type="text" name="felt10=>

</td>
<td width="80"><input name="upload" type="submit"
class="box" id="upload" value=" Upload "></td>
</tr>
</table>
</form>
</body>
</html>

Ralle

--
Vil du lære at kode HTML, XHTML, CSS, SSI, ASP eller ASP.NET?
- Pædagogiske tutorials på dansk
- Kom godt i gang med koderne
KLIK HER! => http://www.html.dk/tutorials

 
 
Peter Brodersen (03-10-2006)
Kommentar
Fra : Peter Brodersen


Dato : 03-10-06 20:28

On 03 Oct 2006 19:20:57 GMT, Ralle <ralle_rass@hotmail.com> wrote:

>   $query = "INSERT INTO test (felt ) ";
> "VALUE ('$feltabcdefghij')";

Denne skal nok være:

   $query = "INSERT INTO test (felt ) ".
"VALUES ('$feltabcdefghij')";

Der er en fejl på hver linje.

--
- Peter Brodersen
Kendt fra Internet

Søg
Reklame
Statistik
Spørgsmål : 177558
Tips : 31968
Nyheder : 719565
Indlæg : 6408925
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste