MārisL Posted October 16, 2007 Report Share Posted October 16, 2007 Topiks pārcelts no šejienes dēļ lielā offtopika: http://php.lv/f/index.php?showtopic=8096 17 punkts man neiet :\. Uzreiz viss teksts kam vajadzētu būt pazūd. Link to comment Share on other sites More sharing options...
andrisp Posted October 16, 2007 Report Share Posted October 16, 2007 Droši vien mēģināji izmantot ’ nevis ' :) (Kā rezultātā PHP nosprāga ar sintakses kļūdu, bet tu to neredzēji, jo error_reporting = off) Link to comment Share on other sites More sharing options...
MārisL Posted October 16, 2007 Author Report Share Posted October 16, 2007 :D Nē, es mēģināju ar ’, bet takā tādu uz sava keybord'a nevarēju ielikt, tad nokopēju to no tā saita un kopēju tik kodā. :\ Mēģināju atkal. Kļūda tā pati. demo Link to comment Share on other sites More sharing options...
andrisp Posted October 16, 2007 Report Share Posted October 16, 2007 Nu bet es tev taču saku, ka jāizmanto parastais ' Link to comment Share on other sites More sharing options...
MārisL Posted October 16, 2007 Author Report Share Posted October 16, 2007 (edited) Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/www/dastm.freehostia.com/komentaari.php on line 52 :\ ieliekot '. echo "<img src='dizains/jaunumi.jpg' alt='' /><br /><i>$row['1']</i><br /> <img src='images/pievienots.gif' alt='pievienots' /><font color='#c0c0c0'> Pievienots: ".date("d-m-Y",$row['3'])."</font><br /><br /> Edited October 16, 2007 by MārisL Link to comment Share on other sites More sharing options...
bubu Posted October 16, 2007 Report Share Posted October 16, 2007 <?php echo $row['1']; ?> Un vai '1' tev tiešām ir lauka nosaukums? Vai tik tu vienkārši negribi otro rezultāta vērtību parādīt? Tad jau vajag vienkārši $row[1]. Eh.. ka skriptu-programmētāji nesaprot kāpēc un neatšķir stringus no integeriem! Link to comment Share on other sites More sharing options...
MārisL Posted October 16, 2007 Author Report Share Posted October 16, 2007 Tiko pamaniju bubu, bet noņēmu to. Tas pats rādas. Link to comment Share on other sites More sharing options...
bubu Posted October 16, 2007 Report Share Posted October 16, 2007 Apskaties uz visu rindu: echo '... '1' ... '; Kā lai php izdomā, kas tas ir par sviestu? Diezgan dabiski, ka sintakses kļūda. Raksti vai nu: echo '... ', $row['1'], ' ... '; Vai arī: echo '... ${row['1']} ... '; Link to comment Share on other sites More sharing options...
andrisp Posted October 16, 2007 Report Share Posted October 16, 2007 Es parasti rakstu '...' . $row['bla'] . '...' Jā, zinu, ka tas ir lēnāk nekā atdalīt ar , :) . Bet nu manuprāt atšķirības ir tikai teorētiskas. Link to comment Share on other sites More sharing options...
MārisL Posted October 16, 2007 Author Report Share Posted October 16, 2007 Ne par tēmu, bet echo veidojot ar ' html kodam, kas ir iekšā ir jāizmanto "? Piem. echo '<font color="fff">testējam</font>'; Link to comment Share on other sites More sharing options...
bubu Posted October 16, 2007 Report Share Posted October 16, 2007 Nē, HTML standartā atribūtu pēdiņas vispār var nelikt. XHTML standartā atribūtu pēdiņas ir vai nu ', vai arī ". Atšķirības nav nekādas. Link to comment Share on other sites More sharing options...
MārisL Posted October 16, 2007 Author Report Share Posted October 16, 2007 52 line echo "<img src='dizains/jaunumi.jpg' alt='' /><br /><i>${row['1']}</i><br /> <img src='images/pievienots.gif' alt='pievienots' /><font color='#c0c0c0'> Pievienots: ".date("d-m-Y",${row['3']})."</font><br /><br /> Kļūda Link to comment Share on other sites More sharing options...
Delfins Posted October 16, 2007 Report Share Posted October 16, 2007 Bet nu manuprāt atšķirības ir tikai teorētiskas. iedomājies 1kb lielu temporārās atmiņas gabalu... un tad tu kopē turpu šurpu... nevis uzreiz izvadi to, kas tev ir. Link to comment Share on other sites More sharing options...
andrisp Posted October 16, 2007 Report Share Posted October 16, 2007 MārisL, imo bija {$bla} nevis ${bla}. Link to comment Share on other sites More sharing options...
MārisL Posted October 16, 2007 Author Report Share Posted October 16, 2007 (edited) Parse error: parse error, unexpected '{' in /home/www/dastm.freehostia.com/komentaari.php on line 51 Ja pareizi sapratu, tad vaina tagad ir pie time echo "<img src='dizains/jaunumi.jpg' alt='' /><br /><i>{$row['1']}</i><br /> <img src='images/pievienots.gif' alt='pievienots' /><font color='#c0c0c0'> Pievienots: ".date("d-m-Y", {$row['3']} )."</font><br /><br /><table width='700' height='15'> Bet kā to atrisināt, lai time strādātu? Edited October 16, 2007 by MārisL Link to comment Share on other sites More sharing options...
Recommended Posts