Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [SQL][PHP]syntax error, unexpected T_STRING
Forum PHP.pl > Forum > Przedszkole
ilidir
witam mam mały problem z tym komunikatem i nie wiem jak go wyelyminować oto kod zapytania SQL


  1. $artykuladd = mysql_query("INSERT INTO ofria_content(id, asset_id, title, alias, title_alias, introtext, fulltext, state, sectionid, mask, catid, created, created_by,
  2. created_by_alias, modified, modified_by, checked_out, checked_out_time, publish_up, publish_down, images, urls, attribs, version, parentid, ordering, metakey, metadesc,
  3. access, hits, metadata, featured, language, xreference) VALUES (NULL, '185', '$sama_nazwa_komisji', '$komisja_string', '', '<p>{jumi [../$miasto_string
  4. /$sama_nazwa_komisji/index_skrypt_eodtest.php]}</p>', '', '1', '0', '0', '81', '2014-11-10 00:00:00', '600', '', '0000-00-00 00:00:00', '0', '0', '0000-00-00 00:00:00',
  5. '0000-00-00 00:00:00', '0000-00-00 00:00:00',
  6. '{"image_intro":"","float_intro":"","image_intro_alt":"","image_intro_caption":"","image_fulltext":"","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":""}',
  7. '{"urla":null,"urlatext":"","targeta":"","urlb":null,"urlbtext":"","targetb":"","urlc":null,"urlctext":"","targetc":""}', '{"show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","sh
  8. ow_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_vote":"","SHOW
  9. _hits":"","show_noauth":"","alternative_readmore":"","article_layout":"","show_publishing_options":"","show_article_options":"","show_urls_images_backend":"","show_urls_ima
  10. ges_frontend":""}', '5', '0', '0', '', '', '0', '0', '{"robots":"","author":"","rights":"","xreference":""}', '0', '*', '')");
Turson
Podpowiedź. Nie:
  1. $string = "ala "ma" kota";

a
  1. $string = "ala \"ma\" kota";
ilidir
no super a może mi kolega naświetlić co robi ten \ questionmark.gifquestionmark.gif? że teraz działa smile.gif
Turson
  1. $string = "ala "ma" kota";

W tej sytuacji łańcuch jest zamykany po ala, aby uniknąć zamknięcia dajemy backslash.
http://php.net/manual/en/language.types.st...g.syntax.double
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.