[MYSQL] Question :)

Gestart doorDigital4 reacties28 weergaven

5 berichten · pagina 1 van 1

Digital

Lid · Topicstarter

Berichten
326
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hallo,
Hoe kan ik ervoor zorgen dat je een item maar 1 keer in de database kan toevoegen?
Per user dan smile
Greetzz,
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM items 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]""[/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]

[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]$sql[/COLOR][COLOR= #007700]) >[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])
{[/COLOR]
      [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt al iets ingevoegd!!![/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]Je hebt nog niks ingevoegd!!![/COLOR][COLOR= #007700];
}[/COLOR]
?>
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
GROUP BY id
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Shahiem schreef:
GROUP BY id
Hij vraagt om invoegen, niet om opvragen smile
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Luukvdo schreef:
Eerdere citaten tonen
Shahiem schreef:
GROUP BY id
Hij vraagt om invoegen, niet om opvragen smile
Oh sorry, niet opgelet smile
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