Re: [PHP] local v remote

2007-05-31 Thread Richard Lynch
On Thu, May 31, 2007 4:50 am, 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?

The problem is probably that you never even managed to connect to the
MySQL database in the first place...

But it could be something else entirely.

We can't tell you, but you can find out by using the mysql_error()
function a lot.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] local v remote

2007-05-31 Thread Robin Vickery

On 31/05/07, blueboy <[EMAIL PROTECTED]> wrote:

On my localhost this works fine

$result= mysql_query("SELECT date_format(date, '%d/%m/%Y') as date, title, id, 
display FROM NEWS");


1. check return values, $result should not be false unless there's a problem.
2. if $result is false, check mysql_error() it'll tell you more about
what's gone wrong.

for example:

$result = mysql_query($query) or die(mysql_error());

-robin

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] local v remote

2007-05-31 Thread blueboy
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?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php