All my scripts have worked before before I tried PHP5. When it didn't work I switched back to PHP4. I am getting database issues with PHP4 now when I didn't before. It only occurs on certain pages. Example:
Page works - http://www.godofgod.co.uk
Code:
mysql_connect("localhost","user","pass");
@mysql_select_db(database) or die( "There has been an error in your request. Please try again! Error: Unable to select database.");
//Just a snippet of everything below for videos.
$query = "SELECT title, id, url, description FROM videos ORDER BY id DESC";
$result2 = mysql_query($query);
$row1 = mysql_fetch_array($result2);
$title2 = $row1['title'];
$ida = $row1['id'];
$url = $row1['url'];
$extract = strip_tags($row1['description']);
//[...]
mysql_close();
Page doesn't work - http://www.godofgod.co.uk/articles/view_article.php?id=27
Code:
mysql_connect("localhost","user","pass");
@mysql_select_db(database) or die( "There has been an error in your request. Please try again! Error: Unable to select database.");
$query="SELECT * FROM articles WHERE id=$id";
$result = mysql_query($query);
if(!$result){
die('Couldn\'t read database.');
};
$row = mysql_fetch_array($result);
$title = $row['title'];
$date = $row['date'];
$body1 = $row['body'];
//[...]
@mysql_select_db(database) or die( "There has been an error in your request. Please try again! Error: Unable to select database.");
$query = "UPDATE articles SET views = $views WHERE id = $id";
$result = mysql_query($query);
$query = "SELECT id FROM users WHERE username = '$username'";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$id_user = $row['id'];
mysql_close();
Can I do anything about this? I'm trying to get my webhost to look at it yet they are being really slow at the moment. It's been like this since the beginning of January.
Thanks for any help given.