🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: be.comp.programming
6 messages
6 total messages Started by Kevin Fri, 09 May 2003 17:07
MYSQL: insert into voegt 2 records toe ipv. 1... please help!
#5286
Author: Kevin
Date: Fri, 09 May 2003 17:07
14 lines
1586 bytes
Wat kan hier nu toch fout lopen, ik zit al gans de dag te zoeken, maar vind
geen oplossing:

---
$sql_vacatures = "INSERT INTO vacatures (naam_voornaam) VALUES ('$naam')";
mysql_query($sql_vacatures);
mysql_close();

header("Location: index.php?pagina=vacatures");
exit;
--

Het probleem is dus dat ie telkens 2 records toevoegd in de database in
plaats van 1.
Re: MYSQL: insert into voegt 2 records toe ipv. 1... please help!
#5288
Author: Roel Schroeven
Date: Fri, 09 May 2003 18:14
22 lines
1856 bytes
Kevin wrote:
> Wat kan hier nu toch fout lopen, ik zit al gans de dag te zoeken, maar vind
> geen oplossing:
> 
> ---
> $sql_vacatures = "INSERT INTO vacatures (naam_voornaam) VALUES ('$naam')";
> mysql_query($sql_vacatures);
> mysql_close();
> 
> header("Location: index.php?pagina=vacatures");
> exit;
> --
> 
> Het probleem is dus dat ie telkens 2 records toevoegd in de database in
> plaats van 1.

Wat staat er in $naam?

-- 
"Codito ergo sum"
Roel Schroeven
http://roelschroeven.net
Re: MYSQL: insert into voegt 2 records toe ipv. 1... please help!
#5290
Author: KLinZ
Date: Fri, 09 May 2003 19:05
17 lines
1692 bytes
Kevin wrote:
> Wat kan hier nu toch fout lopen, ik zit al gans de dag te zoeken,
> maar vind geen oplossing:
>
> ---
> $sql_vacatures = "INSERT INTO vacatures (naam_voornaam) VALUES
> ('$naam')"; mysql_query($sql_vacatures);
> mysql_close();
>
> header("Location: index.php?pagina=vacatures");
> exit;

Wat staat er nog meer in de code die index.php?pagina=vacatures afhandelt?
Misschien wordt deze code twee keer aangeroepen door de redirect?

--
www.zenobits.com
Re: MYSQL: insert into voegt 2 records toe ipv. 1... please help!
#5295
Author: Kevin
Date: Sat, 10 May 2003 14:10
5 lines
1401 bytes
> Wat staat er in $naam?
>

Gewoon tekst bv. 'Kevin'.
Re: MYSQL: insert into voegt 2 records toe ipv. 1... please help!
#5296
Author: Kevin
Date: Sat, 10 May 2003 14:11
7 lines
1513 bytes

> Wat staat er nog meer in de code die index.php?pagina=vacatures afhandelt?
> Misschien wordt deze code twee keer aangeroepen door de redirect?
>

Nee de code wordt niet 2 x aangeroepen. Op index.php staat gewoon html-code.
Re: MYSQL: insert into voegt 2 records toe ipv. 1... please help!
#5297
Author: Roel Schroeven
Date: Sat, 10 May 2003 14:49
16 lines
1906 bytes
Kevin wrote:
>>Wat staat er nog meer in de code die index.php?pagina=vacatures afhandelt?
>>Misschien wordt deze code twee keer aangeroepen door de redirect?
>>
> 
> 
> Nee de code wordt niet 2 x aangeroepen. Op index.php staat gewoon html-code.

Ik zou voor alle zekerheid toch eens nakijken of die code geen twee keer 
wordt aangeroepen, desnoods door iets naar een logfile te schrijven of zo.


-- 
"Codito ergo sum"
Roel Schroeven
http://roelschroeven.net
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads