Jump to content
php.lv forumi

Nevaru atrast kļūdu


reGative

Recommended Posts

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.

Link to comment
Share on other sites

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 ;)!!

Link to comment
Share on other sites

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');
?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...