Forum Moderators: coopster

Message Too Old, No Replies

Firefox PHP Error

         

ifed1290

4:10 pm on Jun 8, 2007 (gmt 0)

10+ Year Member



I have built a site that has a news page that is managed like a blog system (if that makes sence). The display settings for the table that shows the news can be edited from a seperate page. When the page is loaded the fields that configre the display settings show the current settings.

Well, the above is true for IE. when the page is loaded in Firefox it displays this error message:

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/ifed/public_html/newsdesign.php on line 135

Here is lines 134-140 of the code:

$result = mysql_db_query($dbname, "SELECT * FROM newsdesign");
$row = mysql_fetch_assoc($result);
$id = $row["id"];
$sAlignment = $row["sAlignment"];
$sWidth = $row["sWidth"];
$sBSize = $row["sBSize"];
$sBColor = $row["sBColor"];

Does anyone know why it would work in IE but not in Firefox?

jatar_k

4:53 pm on Jun 8, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld ifed1290,

it's not working then. This error means that your query didn't return anything

you should change this line
$result = mysql_db_query($dbname, "SELECT * FROM newsdesign");

to

$result = mysql_db_query($dbname, "SELECT * FROM newsdesign") or die ('select died: ' . mysql_error());

this should give you the actual error returned from mysql.

This can't be browser specific as it is an untrapped error from the database. If IE 'seems' to be working it is only because it is doing something extra for you. The other possibility is that if you are relying on cookie data or something that is stored in your browser to construct your query then it could be a browser issue.

odds are when you are talking about php code, the browser is very seldom the issue.