Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

warning when edit products


ras

Recommended Posts

i instaled some contributions but dont know wich one is giving me this problem as i didn have to edit my products for a while now.

 

the error shows up when i edit my products. at the top of the page i get this

 

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/myfung/public_html/admin/includes/functions/database.php on line 99

 

Warning: reset(): Passed variable is not an array or object in /home/myfung/public_html/admin/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /home/myfung/public_html/admin/includes/classes/object_info.php on line 18

 

where should i look? i chaked the database.php line 99 have this code :

 

 

return mysql_fetch_array($db_query, MYSQL_ASSOC);

 

 

and this is the code for object_info.php on line 17 , 18

 

 

reset($object_array);
  while (list($key, $value) = each($object_array)) {

 

thanks

Link to comment
Share on other sites

it is saying that $db_query isn't a valid resouce.

mysql_fetch_array() takes the result from a mysql query statement.

 

See what $db_query contains it should be somthing like

$db_query = tep_db_query("select ....") or

$db_query = mysql_query("select ....")

 

$db_query then contains a resouce id.

 

The chances are you have just fed the sql query string into mysql_fetch_array to sum up:-

 

Wrong

 

$db_query = "select ...";
return mysql_fetch_array($db_query, MYSQL_ASSOC);

 

Right

$db_query = tep_db_query("select ...");
return mysql_fetch_array($db_query, MYSQL_ASSOC);

 

 

Because this will give an error reset() and each() will give errors becuase they have to be arrays. Have a look just before the reset to see what builds $object_array

 

Hope this helps

Sam

Edited by Nimmit
Link to comment
Share on other sites

it is saying that $db_query isn't a valid resouce.

mysql_fetch_array() takes the result from a mysql query statement.

 

See what $db_query contains it should be somthing like

$db_query = tep_db_query("select ....") or

$db_query = mysql_query("select ....")

 

$db_query then contains a resouce id.

 

The chances are you have just fed the sql query string into mysql_fetch_array to sum up:-

 

Wrong

 

$db_query = "select ...";
return mysql_fetch_array($db_query, MYSQL_ASSOC);

 

Right

$db_query = tep_db_query("select ...");
return mysql_fetch_array($db_query, MYSQL_ASSOC);

Because this will give an error reset() and each() will give errors becuase they have to be arrays. Have a look just before the reset to see what builds $object_array

 

Hope this helps

Sam

 

you are right

 

$db_query = tep_db_query("select ....") or

$db_query = mysql_query("select ....")

 

but i dont have those lines in my code

Link to comment
Share on other sites

  • 7 months later...

I am having the same problem - I get this error while editing/adding products (catagories.php)-

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\catalog\admin\includes\functions\database.php on line 99

 

Here are the lines in database.php

function tep_db_fetch_array($db_query) {

return mysql_fetch_array($db_query, MYSQL_ASSOC); - this is line 99

 

I don't have any other errors, & the error goes away when I put the @ at the front of line 99 - however I do not know exactly what putting the @ does & if I want the error to go away or if it is something I need to find & fix.

 

If anyone has any ideas please let me know.

 

Thanks,

Kristine

www.boxgeek.com

Kristine

Link to comment
Share on other sites

  • 2 months later...
I am having the same problem - I get this error while editing/adding products (catagories.php)-

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\catalog\admin\includes\functions\database.php on line 99

 

Here are the lines in database.php

function tep_db_fetch_array($db_query) {

return mysql_fetch_array($db_query, MYSQL_ASSOC); - this is line 99

 

I don't have any other errors, & the error goes away when I put the @ at the front of line 99 - however I do not know exactly what putting the @ does & if I want the error to go away or if it is something I need to find & fix.

 

If anyone has any ideas please let me know.

 

Thanks,

Kristine

www.boxgeek.com

 

Responding for future searches.

I have found this specific error mostly with incorrect or missing code in admin\includes\classes\order.php, I recommend having a copy of your current store's files along with a copy of default install oscommerce files, and using a compare program like Beyond Compare

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...