homers Posted September 22, 2009 Report Share Posted September 22, 2009 Gribu izveidot video galeriju bet uzķeros uz nelielas ķibelis ar mysql_query, Kods jeb 18rinda: mysql_query "INSERT INTO videos('autors','nosaukums','bilde','kods') VALUES('$_POST['autors']','$_POST['nosaukums']','$_POST['apraksts']','$_POST['kods']')"); Un errors: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\xampp\htdocs\add_v.php on line 18 Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted September 22, 2009 Report Share Posted September 22, 2009 (edited) mysql_query("Te ir kvērijs un viņš ir iekavās"); Es ieteiktu, pirms sāc kaut ko kodēt, pamācīties PHP pamatus. Edited September 22, 2009 by rATRIJS Quote Link to comment Share on other sites More sharing options...
ohmygod Posted September 22, 2009 Report Share Posted September 22, 2009 da lab, ko rājies uzreiz - cilvēkam viena iekava pazudusi. mysql_query( ---||-- ) Quote Link to comment Share on other sites More sharing options...
briedis Posted September 22, 2009 Report Share Posted September 22, 2009 (edited) vēl viņš mēģina masīva vērtību drukāt starp pēdiņām //FAIL: echo "Wow, post dati: $_POST['oh_yeah'], kruta vai ne?"; //NOT FAIL: echo "Wow, post dati: " . $_POST['oh_yeah'] . ", kruta vai ne?"; //vai echo "Wow, post dati: {$_POST['oh_yeah']}, kruta vai ne?"; Nez vai viņš vēl izmanto tādu funkciju kā mysql_real_escape_string() Edited September 22, 2009 by briedis Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted September 22, 2009 Report Share Posted September 22, 2009 da lab, ko rājies uzreiz - cilvēkam viena iekava pazudusi. mysql_query( ---||-- ) paskatoties pārējo kas tur sarakstīts var spriest, ka ne tur vien būs kļūdas :) +1 briedis Quote Link to comment Share on other sites More sharing options...
homers Posted September 23, 2009 Author Report Share Posted September 23, 2009 Nu uzrakstīju šadi mysql_query("INSERT INTO videos('autors','nosaukums','bilde','kods') VALUES('$_POST['autors']','$_POST['nosaukums']','$_POST['apraksts']','$_POST['kods']')"); Rada Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\xampp\htdocs\add_v.php on line 19 Quote Link to comment Share on other sites More sharing options...
Klez Posted September 23, 2009 Report Share Posted September 23, 2009 "INSERT INTO videos('autors','nosaukums','bilde','kods') VALUES('".$_POST['autors']."',..." vai "INSERT INTO videos('autors','nosaukums','bilde','kods') VALUES('{$_POST['autors']}', Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.