reGative Posted June 30, 2010 Report Share Posted June 30, 2010 Sveiki atkal! Radās vajadzība uzkodēt easy blogu. Bet ir problēmas. Errors - Parse error: syntax error, unexpected T_VARIABLE in /home/a2965386/public_html/blogs/includes/init.php on line 1 init.php <?php $con = mysql_connect("mysql13.000webhost.com","a2965386_rg","losw_dev_blog"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("a2965386_rg", $con); ?> Es šeit nekur nesaskatu kļūdu. Quote Link to comment Share on other sites More sharing options...
emsy Posted July 1, 2010 Report Share Posted July 1, 2010 Tas parāda, ka ir problēmas ar (vot neatceros kā viņus sauca) slēptajiem simboliem, lai to labotu, visu faila saturu pārkopē uz jaunu dokumentu, ar kuru aizstāj veco ;)!! Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted July 1, 2010 Report Share Posted July 1, 2010 Visticamāk teksta redaktors, kurš saglabā UTF-8 kodējumā ar BOM Paņem teksta redaktoru, kurš prot saglabāt arī bez BOM, piemēram Notepad++ (neticu, ka ne windows vidē Tev ir šāda problēma ;) ) Quote Link to comment Share on other sites More sharing options...
reGative Posted July 1, 2010 Author Report Share Posted July 1, 2010 Skaidrs, turpmāk zināšu. Tagad šāds errors - Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/a2965386/public_html/blogs/index.php on line 6. index.php <?php include('includes/init.php'); include('header.php'); $result = mysql_query("SELECT * FROM news"); while($row = mysql_fetch_array($result)) { echo '<p class="time">'.$row['datums'].'</p>'; echo '<div class="title">'.$row['nosaukums'].'</div>'; echo '<p class="comment">'.$row['teksts'].'</p>'; echo '<p class="userComment">Ievietoja '.$row['autors'].'</p>'; } include('footer.php'); ?> Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted July 1, 2010 Report Share Posted July 1, 2010 Tātad kļūda SQLā. Pārveido 5. rindiņu: $result = mysql_query("SELECT * FROM news") or die('SQL kļūda '.mysql_error()); P.S. Cerams, ka "a2965386_rg","losw_dev_blog" nav īstie username/password... Quote Link to comment Share on other sites More sharing options...
reGative Posted July 1, 2010 Author Report Share Posted July 1, 2010 Paldies. Mle, būtu es visu pārbaudījis, tad būtu cita lieta. :D P.S. Bet vai paroli ir tik grūti arī nomainīt? :D 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.