Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]unexpected T_STRING
Raven1122
post
Post #1





Grupa: Zarejestrowani
Postów: 369
Pomógł: 2
Dołączył: 1.11.2010

Ostrzeżenie: (0%)
-----


Witam. Problem polega na przypisywaniu zmiennej tresco z POST. Cokolwiek bym nie zrobil jest unexpected T_STRING.


Blad:
Parse error: syntax error, unexpected T_STRING in /home/bassplay/public_html/nicco/php/ask.php on line 3

Oto Kod:
  1. <?php
  2. $id = 1;
  3. $subject = '$_POST['subject']';
  4. $content = '$_POST['content']';
  5. $askauthor = '$_POST['nick']';
  6.  
  7.  
  8.  
  9.  
  10. $link = mysql_connect('xxx', 'xxx', 'xxx') or die(mysql_error());
  11. $result = mysql_query($link);
  12. mysql_select_db(bassplay_nicco) or die(mysql_error());
  13.  
  14. $sql = "INSERT INTO blog_asktool(id, subject, question, questionauthor) " .
  15. "VALUES ($id, $subject, $content, $askauthor) ";
  16. $result = mysql_query($sql) or die(mysql_error());
  17. $id = $i++;
  18. echo "Gratulacje";
  19. ?>


Ten post edytował Raven1122 22.08.2011, 09:28:16
Go to the top of the page
+Quote Post

Posty w temacie


Closed TopicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 02:17