Wat is er verkeerd aan dit?
dit is de fout melding:PHP Code:
mysql_query("INSERT INTO upcoming-events (naam, datum, plaatsnaam, leeftijd, openingstijd, prijs_voorverkoop, prijs_aandeur, consumptie, informatie) VALUES ('" . $this->naam . "', '" . $this->datum . "', '" . $this->plaatsnaam . "', '" . $this->leeftijd . "', '" . $this->openingstijd . "', '" . $this->voorverkoop . "', '" . $this->aandeur . "', '" . $this->consumptie . "', '" . $this->informatie . "')");
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 '-events (naam, datum, plaatsnaam, leeftijd, openingstijd, prijs_voorverkoop, pri' at line 1
- mysql fout
-
12-12-2009, 15:38 #1
- Berichten
- 394
- Lid sinds
- 15 Jaar
mysql fout
-
In de schijnwerper
-
12-12-2009, 16:00 #2
- Berichten
- 137
- Lid sinds
- 16 Jaar
Krijg je deze error nog steeds als je '' om upcoming-events zet?
-
12-12-2009, 16:03 #3
- Berichten
- 157
- Lid sinds
- 16 Jaar
Dat zou het idd wel eens kunnen zijn, alleen zou ik geen " gebruiken, want die wordt al om de hele query heen gebruikt.
Meestal wordt dit gebruikt voor om namen van tabellen ed:PHP Code:INSERT INTO `upcoming-events` (
-
12-12-2009, 16:04 #4
- Berichten
- 137
- Lid sinds
- 16 Jaar
-
12-12-2009, 16:11 #5
- Berichten
- 84
- Lid sinds
- 17 Jaar
ik zou deze is proberen
PHP Code:mysql_query("INSERT INTO `upcoming-event` (`naam`, `datum`, `plaatsnaam`, `leeftijd`, `openingstijd`, `prijs_voorverkoop`, `prijs_aandeur`, `consumptie`, `informatie`) VALUES ('" . $this->naam . "', '" . $this->datum . "', '" . $this->plaatsnaam . "', '" . $this->leeftijd . "', '" . $this->openingstijd . "', '" . $this->voorverkoop . "', '" . $this->aandeur . "', '" . $this->consumptie . "', '" . $this->informatie . "')");
-
12-12-2009, 16:46 #6
- Berichten
- 394
- Lid sinds
- 15 Jaar
ty, hij doet het;)
-
13-12-2009, 12:21 #7
- Berichten
- 376
- Lid sinds
- 18 Jaar
Dat zijn backticks (`) en doen helemaal niets in je query, is alleen om het wat beter leesbaar te maken.
-
13-12-2009, 12:24 #8
- Berichten
- 1.669
- Lid sinds
- 19 Jaar
-
13-12-2009, 12:26 #9
- Berichten
- 376
- Lid sinds
- 18 Jaar
Ja, daar heb je wel gelijk in. Maar die moet je inderdaad vermijden.
Plaats een
- + Advertentie
- + Onderwerp
Marktplaats
Webmasterforum
- Websites algemeen
- Sitechecks
- Marketing
- Domeinen algemeen
- Waardebepaling
- CMS
- Wordpress
- Joomla
- Magento
- Google algemeen
- SEO
- Analytics
- Adsense
- Adwords
- HTML / XHTML
- CSS
- Programmeren
- PHP
- Javascript
- JQuery
- MySQL
- Ondernemen algemeen
- Belastingen
- Juridisch
- Grafisch ontwerp
- Hosting Algemeen
- Hardware Info
- Offtopic