Re: local v remote

From: Date: Thu, 31 May 2007 09:59:15 +0000
Subject: Re: local v remote
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-255898@lists.php.net to get a copy of this message
blueboy wrote:
On my localhost this works fine $result= mysql_query("SELECT date_format(date, '%d/%m/%Y') as date, title, id, display FROM NEWS"); while ($row = mysql_fetch_assoc($result)) { but on my remote i get a mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource Can someone expalin the problem? PHP version problem?
No. It's MySQL problem. If it works fine locally, then make sure the table structure is the same on your remote database as it is on your local database. --- mysql_query("SELECT date_format(date, '%d/%m/%Y') as date, title, id, display FROM NEWS") or die(mysql_error()); --- Using that die statement will also help while debugging your script as it will print out any errors that are caused by your SQL statement. Which you then ask some mysql people if that is the case. Darren

« previous php.general (#255898) next »