[PHP-mysql] insert into

Gestart doorMarjolein15 reacties55 weergaven

16 berichten · pagina 1 van 2

Marjolein

Lid · Topicstarter

Berichten
15.446
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoi medescripters yummie
Ik heb even een vraag, ik zoek een manier om informatie in te voegen in 2 verschillende tabellen via 1 query kan dit? Ik heb via google gezocht maar dan zie ik allemaal voorbeelden met 2 querys. Kan iemand eventueel een voorbeeldje posten?
Alvast bedankt.
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Kan niet. clown
Wat is precies je doel en waarom wil je dat per se met 1 query doen?
0
Marjolein

Lid · Topicstarter

Berichten
15.446
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Jammer, ik dacht het net zoals met gegevens ophalen ook kon. Maar het leek me gewoon makkelijker in 1 query, maar dan doe ik het wel met 2.

Ik ga het even proberen, als het niet lukt dan vraag ik het hier nog wel.
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Ok succes thumbsup
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Marjolein schreef:
Jammer, ik dacht het net zoals met gegevens ophalen ook kon. Maar het leek me gewoon makkelijker in 1 query, maar dan doe ik het wel met 2.

Ik ga het even proberen, als het niet lukt dan vraag ik het hier nog wel.
Dacht zocht ik ook eerst. yummie
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Ik snap het voordeel er niet van. emo
0
Marjolein

Lid · Topicstarter

Berichten
15.446
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
hmz, gaat toch niet echt lukken. Tenminste ik weet wel hoe het moet maar ik zit met een ander probleem.

Kijk, ik heb dus een website waar ik blogs op plaats, op die blogs kunnen bezoekers stemmen. Maar als ik een blog plaats dan zijn er nog geen stemmen en krijg ik een error dus ik dacht dit te voorkomen door tegelijkertijd een stem te geven maar het systeem weet natuurlijk nog niet wel id die blog krijgt. Dus kan het niet. Of iemand anders kan hier een oplossing voor verzinnen?
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Kun je het stukje code geven wat dan voor die error zorgt als er nog geen stemmen zijn?

Je kunt er wel meteen een stem bij doen (met mysql_insert_id() krijg je het ID van je blog), maar dan heeft elke blog al een stem terwijl er niemand op heeft gestemd.. dus kun je beter die fout oplossen die je krijgt als er nog niet gestemd is.
0
Marjolein

Lid · Topicstarter

Berichten
15.446
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Spoiler tonen
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]//stemmen + cijfer
                    //Kijken of ip al niet in de database bevind:[/COLOR]
                    [COLOR= #0000BB]$ipQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT 1 FROM stemmen WHERE ip = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REMOTE_ADDR[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]" 
                    AND blog = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$rec1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
                        [COLOR= #FF8000]// cijfer berekenen[/COLOR]
                        [COLOR= #0000BB]$total_plus[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_result"]mysql_result[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT COUNT(stem) FROM stemmen WHERE stem=1 AND blog = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$rec1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]),[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]);[/COLOR]
                        [COLOR= #0000BB]$total_total[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_result"]mysql_result[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT COUNT(stem) FROM stemmen WHERE blog = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$rec1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]),[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]);[/COLOR]
                        [COLOR= #0000BB]$total_plus_vote[/COLOR] [COLOR= #007700]= ([/COLOR] [COLOR= #0000BB]$total_plus[/COLOR] [COLOR= #007700]*[/COLOR] [COLOR= #0000BB]10[/COLOR][COLOR= #007700]);[/COLOR]
                        [COLOR= #0000BB]$uitkomst[/COLOR] [COLOR= #007700]= (([/COLOR][URL="http://www.php.net/round"]round[/URL][COLOR= #007700](([/COLOR][COLOR= #0000BB]$total_plus_vote[/COLOR] / [COLOR= #0000BB]$total_total[/COLOR][COLOR= #007700]),[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])) *[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]);[/COLOR]
                        
                            [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ipQuery[/COLOR][COLOR= #007700]) !=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
                            {[/COLOR]
                            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div class="stemmen">Je hebt al op 
                            <a href="#" title="Gestemd: + [/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$aant[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aantalplus[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000], - [/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$aant[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aantalmin[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"><b>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$rec1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"</b></a> gestemd!
                            &nbsp;-&nbsp;<i>Het gemiddelde cijfer voor [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$rec1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000] :<b> [/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$uitkomst[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]</b></i>
                            </div>[/COLOR][COLOR= #007700];
                            }[/COLOR]
                            [URL="http://www.php.net/else"]else[/URL]
                            [COLOR= #007700]{[/COLOR]
                            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div class="stemmen">Stem op <a href="#" title="Gestemd: + [/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$aant[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aantalplus[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000], - [/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$aant[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aantalmin[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"><b>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$rec1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"</b></a> :&nbsp;
                            <a href="index.php?p=blogding&amp;act=stem1&amp;id=[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$rec1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" title="+1 stem!"><img src="images/stemplus.png" alt="+1" /></a>
                            <a href="index.php?p=blogding&amp;act=stem2&amp;id=[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$rec1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" title="-1 stem!"><img src="images/stemmin.png" alt="-1" /></a>
                            &nbsp;-&nbsp;<i>Het gemiddelde cijfer voor [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$rec1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000] :<b> [/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$uitkomst[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]</b></i>
                            </div>[/COLOR][COLOR= #007700];
                            }[/COLOR]
                    [COLOR= #FF8000]//einde stemmen + cijfer[/COLOR]
?>
Hij haalt dus het aantal stemmen op maar als er nog niet gestemd is is valt er niks te tellen dus dan geeft die zon error met "division zero" of zo.
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Lennard schreef:
Kan niet. clown
Wat is precies je doel en waarom wil je dat per se met 1 query doen?

kan wel:

CASCADE, Foreign Keys
het fijne weet ik er niet van, maar het lijkt wel degelijk te kunnen.
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@Marjolein : eerst kijken of er in de tabel al stemmen zijn voor die poll, zo ja, voer de rest uit, anders zeggen dat er nog geen stemmen zijn yummie
0
Marjolein

Lid · Topicstarter

Berichten
15.446
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Maartenl schreef:
@Marjolein : eerst kijken of er in de tabel al stemmen zijn voor die poll, zo ja, voer de rest uit, anders zeggen dat er nog geen stemmen zijn yummiepfff, soms denk ik gewoon echt zo moeilijk waarom kwam ik hier niet op? sadley
toevoeging op 29 februari 2012, 171458:
ik doe het denk ik nog fout want ik blijf toch die foutmelding zien sadleyWarning: Division by zero in /home/marjolein/domains/marboek.nl/public_html/pages/blogding_test.php on line 313
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]//stemmen + cijfer
                    //Kijken of ip al niet in de database bevind:[/COLOR]
                    [COLOR= #0000BB]$ipQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT 1 FROM stemmen WHERE ip = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REMOTE_ADDR[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]" 
                    AND blog = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$rec1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
                        [COLOR= #FF8000]// cijfer berekenen[/COLOR]
                        [COLOR= #0000BB]$total_plus[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_result"]mysql_result[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT COUNT(stem) FROM stemmen WHERE stem=1 AND blog = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$rec1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]),[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]);[/COLOR]
                        [COLOR= #0000BB]$total_total[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_result"]mysql_result[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT COUNT(stem) FROM stemmen WHERE blog = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$rec1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]),[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]);[/COLOR]
                        [COLOR= #0000BB]$total_plus_vote[/COLOR] [COLOR= #007700]= ([/COLOR] [COLOR= #0000BB]$total_plus[/COLOR] [COLOR= #007700]*[/COLOR] [COLOR= #0000BB]10[/COLOR][COLOR= #007700]);[/COLOR]
                        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$total_total[/COLOR] [COLOR= #007700]>[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])[/COLOR]
                            [COLOR= #0000BB]$uitkomst[/COLOR] [COLOR= #007700]= (([/COLOR][URL="http://www.php.net/round"]round[/URL][COLOR= #007700](([/COLOR][COLOR= #0000BB]$total_plus_vote[/COLOR] / [COLOR= #0000BB]$total_total[/COLOR][COLOR= #007700]),[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])) *[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]);[/COLOR]
                        
                        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div class="stemmen">[/COLOR][COLOR= #007700];[/COLOR]
                        
                        [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ipQuery[/COLOR][COLOR= #007700]) !=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
                        {[/COLOR]
                            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt al op <a href="#" title="Gestemd: + [/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$aant[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aantalplus[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000], - [/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$aant[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aantalmin[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"><b>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$rec1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"</b></a> gestemd![/COLOR][COLOR= #007700];
                        }[/COLOR]
                        [URL="http://www.php.net/else"]else[/URL]
                        [COLOR= #007700]{[/COLOR]
                            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Stem op <a href="#" title="Gestemd: + [/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$aant[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aantalplus[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000], - [/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$aant[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aantalmin[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"><b>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$rec1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"</b></a> :&nbsp; <a href="index.php?p=blogding&amp;act=stem1&amp;id=[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$rec1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" title="+1 stem!"><img src="images/stemplus.png" alt="+1" /></a> <a href="index.php?p=blogding&amp;act=stem2&amp;id=[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$rec1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" title="-1 stem!"><img src="images/stemmin.png" alt="-1" /></a>[/COLOR][COLOR= #007700];
                        }[/COLOR]
                        
                        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]&nbsp;-&nbsp;<i>[/COLOR][COLOR= #007700];[/COLOR]
                        
                        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uitkomst[/COLOR][COLOR= #007700]))[/COLOR]
                            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Het gemiddelde cijfer voor [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$rec1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000] :<b> [/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$uitkomst[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]</b></i>[/COLOR][COLOR= #007700];[/COLOR]
                        [URL="http://www.php.net/else"]else[/URL]
                            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Er is nog niet op [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$rec1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]gestemd[/COLOR][COLOR= #007700];[/COLOR]
                        
                        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</i>
                        </div>[/COLOR][COLOR= #007700];[/COLOR]
                    [COLOR= #FF8000]//einde stemmen + cijfer[/COLOR]
?>


Probeer het zo eens smile
0
Marjolein

Lid · Topicstarter

Berichten
15.446
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Youre my hero biggrinDank je wel Luuk, foutmelding is weg.
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Marjolein schreef:
Jammer, ik dacht het net zoals met gegevens ophalen ook kon. Maar het leek me gewoon makkelijker in 1 query, maar dan doe ik het wel met 2.

Ik ga het even proberen, als het niet lukt dan vraag ik het hier nog wel.
Het kan inderdaad niet met 1 query. Je kan wel 2 queries uitvoeren in 1 mysql functie. Vele doen ze apart, dit gaat zo gewoon sneller (geloof ik confused).

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE tabelnaam SET field=input; INSERT INTO tabelnaam (field1, field2, field3) VALUES (input1, input2, input3);"[/COLOR][COLOR= #007700]);[/COLOR]
?>
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren