We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,280 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Issues with localhost programming and online

Hi,

I developed a website with PHP version 5.1.4 and MySQL - 5.0.22. I tested the web on my localhost and it worked perfectly well. However, when I uploaded the website, I could not have access to all have to all the data inserted in my database. I could not understand the reason for this. However, after complaining to the hosting company, it was suggested that probably there is a difference in the php.ini of my localhost and that of the hosting company. The php.ini of the web hosting company is Debian, MySQL Version: 5.0.91, Perl Version: 5.8.8. Being a newbie in this, is it possible that the difference in this developmental portal and the hosting portal could lead to my inability to access of my data in the database of the hosting company?

Thanks.

3
Contributors
4
Replies
1 Day
Discussion Span
9 Months Ago
Last Updated
5
Views
omoayan
Newbie Poster
13 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

I suggest you to create a simple file and try the connection and a query to your database, something like this:

<?php

# config parameters
$host = '';
$user = '';
$pass = '';
$db = '';
$table = '';

$conn = mysql_connect($host,$user,$pass);
if (!$conn)
{
        die('connection error: ' . mysql_error());
}

mysql_select_db($db, $conn) or die('database error: '.mysql_error());

$q = mysql_query("select * from $table") or die('query error: ' .mysql_error());
echo 'result: ' . mysql_num_rows($q);
?>

This is very basic, try if it works and if you're in doubt, post back any error you get.
P.S. remember to set the correct config parameters.

cereal
Veteran Poster
1,146 posts since Aug 2007
Reputation Points: 344
Solved Threads: 223
Skill Endorsements: 22

Thanks Cereal. I have done this in my localhost and it works well. I copied this same file to the hosting company, with some modifications, taking into cognizance their host. It was from here that I am having issues. I am open to further suggestions.

omoayan
Newbie Poster
13 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Ok, when you've tried this on your hosting did you got any errors? If yes, can you paste the output here? I suggested you this test just to check if the connection with the database of the hosting was working fine.

Otherwise post your code or at least a simplified version of it in which the problem is occurring. If I don't understand which kind of error you get I cannot help.

cereal
Veteran Poster
1,146 posts since Aug 2007
Reputation Points: 344
Solved Threads: 223
Skill Endorsements: 22

What is the php version of your hosting company? You mentioned perl or was that a typo?

iamthwee
Posting Genius
6,254 posts since Aug 2005
Reputation Points: 1,567
Solved Threads: 476
Skill Endorsements: 34

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0677 seconds using 2.7MB