Toon posts:

[PHP] Wat is dr nou fout GRR!!

Pagina: 1
Acties:
  • 35 views sinds 30-01-2008

Verwijderd

Topicstarter
mn script is:
$query = "UPDATE `auto` SET `afbeelding` = \$img1_name\ WHERE `modelid` = \'$id\' LIMIT 1;";

en het script zegt op de pagina:
You have an error in your SQL syntax near '\ WHERE `modelid` = \'1005\' LIMIT 1' at line 1

ik heb bijna alles geprobeert om m goed te krijgen, dus nu hoop ik dat er hier iemand zo goed is dat hij dit kan fixen...
wie is hier slim?
thanz

  • Dennis
  • Registratie: Februari 2001
  • Laatst online: 11:35
\$img1_name\ tussen `

Verwijderd

Topicstarter
wat bedoel je?

  • johnny7
  • Registratie: November 2000
  • Laatst online: 07-11-2023
Strings moeten tussen quotes, dus de waarde van $img_name moet omgeven zijn met quotes.

  • Shadowman
  • Registratie: Januari 2002
  • Niet online
@Dennis: normale single-quote. Die jij nu geeft is voor de tabellen.
'$img1_name' ipv \$img1_name\

En singlequotes mag je blijkbaar niet escapen. (Wordt iig bij php wel de \ doorgegeven als je een singlequote probeert te escapen).

Verwijderd

Topicstarter
nu zegt ie:
You have an error in your SQL syntax near '\'crowd.jpg'\ WHERE `modelid` = \'1005\' LIMIT 1' at line 1

[ Voor 13% gewijzigd door Verwijderd op 13-06-2004 22:24 ]


  • Tux
  • Registratie: Augustus 2001
  • Laatst online: 13:47

Tux

$query = "UPDATE `auto` SET `afbeelding` = \$img1_name\ WHERE `modelid` = \'$id\' LIMIT 1;";

$query = "UPDATE auto SET afbeelding = '" . $img1_name . "' WHERE modelid = '" . $id . "' LIMIT 1";

The NS has launched a new space transportation service, using German trains which were upgraded into spaceships.


  • Janoz
  • Registratie: Oktober 2000
  • Laatst online: 12:00

Janoz

Moderator Devschuur®

!litemod

Lees eerst maar ff de faq door. Titel van niks en een simpel parse probleem.

Ken Thompson's famous line from V6 UNIX is equaly applicable to this post:
'You are not expected to understand this'

Pagina: 1

Dit topic is gesloten.