Code: Select all
<?php
$var = $arr['xyz'];
// but
$var = " ... $arr[xyz] ...";
// or
$var = " ... {$arr['xyz']} ...";http://www.php.net/manual/en/language.t ... tax.double
http://www.php.net/manual/en/language.t ... rray.donts
Moderator: General Moderators
Code: Select all
<?php
$var = $arr['xyz'];
// but
$var = " ... $arr[xyz] ...";
// or
$var = " ... {$arr['xyz']} ...";ddragas wrote:Thank you all for reply
volkas code goves me what I need, and my next problem is how to insert values from form into db ?
I've tried what you've suggested me, but with no result of course with changed sql query
I get error in sql query, and error is
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\Program Files\Apache Group\Apache2\htdocs\skola\Untitled-2.php on line 14
SQL QUERY WITH ERRORCode: Select all
$sql = "INSERT INTO ocijene SET ocijena_usmeno = '$array['pawn']', ocijena_pismeno = '$array['verbal_testing']', ocijena_zalaganje = '$array['written_testing']', ucenik = '$array['student_id']'";
Code: Select all
INSERT INTO *where* (*TABLE NAMES*) VALUES(*VALUES FOR EACH COLUMN*);