[Opgelost]Error SQL Syntax
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
// Includes
include"config.php";
// Gegevens uit de Database halen.
$sql1 = mysql_query("SELECT
adres_id,
voornaam,
achternaam
FROM
adressen
ORDER BY
adres_id
ASC ");
// Errors
mysql_query($sql1) or die(mysql_error());
// Gegevens // Loops
$record = mysql_fetch_assoc($sql1);
// Alle items Echoën
echo("{$record['voornaam']} {$record['achternaam']}");
?>
// Includes
include"config.php";
// Gegevens uit de Database halen.
$sql1 = mysql_query("SELECT
adres_id,
voornaam,
achternaam
FROM
adressen
ORDER BY
adres_id
ASC ");
// Errors
mysql_query($sql1) or die(mysql_error());
// Gegevens // Loops
$record = mysql_fetch_assoc($sql1);
// Alle items Echoën
echo("{$record['voornaam']} {$record['achternaam']}");
?>
Gewijzigd op 01/01/1970 01:00:00 door ---- ----
Je voert je query twee keer uit. Bovendien hoort de ; niet achter ASC
Klaasjan Boven schreef op 08.01.2010 23:02:
Je voert je query twee keer uit. Bovendien hoort de ; niet achter ASC
Ik heb nu dus.
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
// Includes
include"config.php";
// Gegevens uit de Database halen.
$sql1 = mysql_query("SELECT
adres_id,
voornaam,
achternaam
FROM
adressen
ORDER BY
adres_id
ASC ");
// Errors
mysql_query($sql1) or die(mysql_error());
// Gegevens // Loops
$record = mysql_fetch_assoc($sql1);
// Alle items Echoën
echo("{$record['voornaam']} {$record['achternaam']}");
?>
// Includes
include"config.php";
// Gegevens uit de Database halen.
$sql1 = mysql_query("SELECT
adres_id,
voornaam,
achternaam
FROM
adressen
ORDER BY
adres_id
ASC ");
// Errors
mysql_query($sql1) or die(mysql_error());
// Gegevens // Loops
$record = mysql_fetch_assoc($sql1);
// Alle items Echoën
echo("{$record['voornaam']} {$record['achternaam']}");
?>
Wat moet ik dan veranderen heb al die ; achter ASC weggehaald
Maar waar voer ik de query 2x uit.. ?
Regel 6 moet mysql_query() weg, dat is de sql. De query voer je op regel 18 uit.
SanThe schreef op 08.01.2010 23:07:
Regel 6 moet mysql_query() weg, dat is de sql. De query voer je op regel 18 uit.
Bedankt ik heb het weggehaald en het werkt bedankt;)
En klaasjan ook bedankt(Y)
Gewijzigd op 01/01/1970 01:00:00 door ---- ----
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
// Includes
include"config.php";
// Gegevens uit de Database halen.
$sql1 = "SELECT
adres_id,
voornaam,
achternaam
FROM
adressen
ORDER BY
adres_id ASC
";
// Errors
$res1 = mysql_query($sql1) or die(mysql_error());
// Gegevens // Loops
while($record = mysql_fetch_assoc($res1))
{
// Alle items Echoën
echo $record['voornaam'] . ' ' . $record['achternaam'] . '<br />';
}
?>
// Includes
include"config.php";
// Gegevens uit de Database halen.
$sql1 = "SELECT
adres_id,
voornaam,
achternaam
FROM
adressen
ORDER BY
adres_id ASC
";
// Errors
$res1 = mysql_query($sql1) or die(mysql_error());
// Gegevens // Loops
while($record = mysql_fetch_assoc($res1))
{
// Alle items Echoën
echo $record['voornaam'] . ' ' . $record['achternaam'] . '<br />';
}
?>
SanThe schreef op 08.01.2010 23:13:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
// Includes
include"config.php";
// Gegevens uit de Database halen.
$sql1 = "SELECT
adres_id,
voornaam,
achternaam
FROM
adressen
ORDER BY
adres_id ASC
";
// Errors
$res1 = mysql_query($sql1) or die(mysql_error());
// Gegevens // Loops
while($record = mysql_fetch_assoc($res1))
{
// Alle items Echoën
echo $record['voornaam'] . ' ' . $record['achternaam'] . '<br />';
}
?>
// Includes
include"config.php";
// Gegevens uit de Database halen.
$sql1 = "SELECT
adres_id,
voornaam,
achternaam
FROM
adressen
ORDER BY
adres_id ASC
";
// Errors
$res1 = mysql_query($sql1) or die(mysql_error());
// Gegevens // Loops
while($record = mysql_fetch_assoc($res1))
{
// Alle items Echoën
echo $record['voornaam'] . ' ' . $record['achternaam'] . '<br />';
}
?>
Bedankt dat je het script hebt verbeterd