vitao.web Posted February 16, 2010 Author Report Share Posted February 16, 2010 Man radas errors: Parse error: syntax error, unexpected '}' in **********\zinas.php on line 28 Bet man nav tādas vietas '}' ... kas pa kļūmīti ? :) <?php $tabula = "zinas"; $name = mysql_real_escape_string($_POST['nosaukums']); $author = mysql_real_escape_string($_POST['autors']); $message = mysql_real_escape_string($_POST['raksts']); $class = mysql_real_escape_string($_POST['sadala']); $ip = $_SERVER['REMOTE_ADDR']; { if(!isset($_GET['page'])){ $page = 1; } else { $page = $_GET['page']; } $max_results = 1; $from = (($page * $max_results) - $max_results); if (!isset($_POST['nosaukums'])) { $query = ("SELECT * FROM $tabula order by id desc LIMIT $from, $max_results"); $result = mysql_query($query); while ($row = mysql_fetch_object($result))} } ?> Link to comment Share on other sites More sharing options...
briedis Posted February 16, 2010 Report Share Posted February 16, 2010 while ($row = mysql_fetch_object($result))} Problēma visdrīzāk ir tajā, ka paņem kaut kādu gatavu koda gabalu (relatīvi sarežģītu), un tad mēģini piedabūt lai strādā, nesaprotot pat vienkāršākos php pamatus... Link to comment Share on other sites More sharing options...
vitao.web Posted February 16, 2010 Author Report Share Posted February 16, 2010 while ($row = mysql_fetch_object($result))} Problēma visdrīzāk ir tajā, ka paņem kaut kādu gatavu koda gabalu (relatīvi sarežģītu), un tad mēģini piedabūt lai strādā, nesaprotot pat vienkāršākos php pamatus... Un ko tu ieteiktu ta vieta nemt? jeb ka pareizak uzrakstit? Link to comment Share on other sites More sharing options...
briedis Posted February 16, 2010 Report Share Posted February 16, 2010 Un ko tu ieteiktu ta vieta nemt? jeb ka pareizak uzrakstit? Es ieteiktu iet pamācīties php pamatus... Link to comment Share on other sites More sharing options...
waplet Posted February 16, 2010 Report Share Posted February 16, 2010 (edited) Nav ko likt.. kur php ir beta un mysql ir dev :D aiz while.. } samaini ar { Edited February 16, 2010 by waplet Link to comment Share on other sites More sharing options...
vitao.web Posted February 16, 2010 Author Report Share Posted February 16, 2010 Nav ko likt.. kur php ir beta un mysql ir dev :D aiz while.. } samaini ar { nesanak , tad seko nakosais errors :( Link to comment Share on other sites More sharing options...
eude Posted February 16, 2010 Report Share Posted February 16, 2010 waplet: paskaties koda tagus, un sapratīsi, ka tas nelīdzēs. tieši, tad trūks vēl 2 aizverošie } kas attiecās uz problēmu, nezinu vai man ir taisnība šajā gadījumā, jo neesmu to nekad testējis, bet kāpēc tev šī daļa ir ielikta starp {}? { if(!isset($_GET['page'])){ $page = 1; } else { $page = $_GET['page']; } $max_results = 1; $from = (($page * $max_results) - $max_results); if (!isset($_POST['nosaukums'])) { $query = ("SELECT * FROM $tabula order by id desc LIMIT $from, $max_results"); $result = mysql_query($query); while ($row = mysql_fetch_object($result))} } Link to comment Share on other sites More sharing options...
vitao.web Posted February 16, 2010 Author Report Share Posted February 16, 2010 Jo ta tas bija orginalaja koda, bet nu nonemu un ta pat radas pats errors :S Varbut to daulu ar while var kka savadak apiet, uzrakstit? Link to comment Share on other sites More sharing options...
vitao.web Posted February 16, 2010 Author Report Share Posted February 16, 2010 ATRISINAJU VISU! Varat topic close! :) Link to comment Share on other sites More sharing options...
waplet Posted February 16, 2010 Report Share Posted February 16, 2010 Tu pats vari aizslēgt.. Moderation Options.. lejā. Link to comment Share on other sites More sharing options...
Recommended Posts