Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

SQL Query Troubles


Recommended Posts

I am trying to get 2 contribs to work together: The "Add Customers from Admin" contrib, and the "Separate Pricing per customer" contrib.


Here's my problem. When adding a new customer via the admin, the "Add customer" contrib isn't set up to add a "Price Group" (which comes in the "SPPC" contrib)


I get this error when it is supposed to display the existing group of the customer

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


However, I have determined the problem to actually be in the file /catalog/admin/customers.php on line 862 where the following code is displayed


$index = 0;
  echo ("Existing Groups: ");
  while ($existing_customers =  tep_db_fetch_array($existing_customers_query)) {
    echo ($existing_customers['customers_group_name']);
    echo (", ");
    if ($index%10 == 0) {
    echo (" ");


How do I change this SQL Query to say "Display the group (which it already says) UNLESS there is not that information in the database. In other words : If "customers_group_name does not exist, echo "No Group Assigned"?


Also, it's not allowing me to insert a new customer because it's not recognizing the customers_group_name information that is being input... so where do I add that to allow the information to be passed to the DB and create the account?


MANY thanks in advance... I know this might be a little more time consuming, but it shouldn't be for someone that knows more of what their doing.

Link to comment
Share on other sites

i think it could be something missing in your installation, as i have both those working with lots of other contributions. double check the installation. have you tried changing any code?

Link to comment
Share on other sites

Well I have got them both to work separately... just not together. Maybe I put some of the code in the wrong place when installing, but I don't know how I would tell. I can't really post my whole page of code here, so how would I be able to let you see it?

Link to comment
Share on other sites

when I try to insert a customer, these are the warnings I get:


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


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

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...