Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

if (!tep_session_is_registered('customers_id'))


custodian

Recommended Posts

Ok.. I'm playing around with some code trying to fully graps everything. My structure appears correct but my results are not. When I run the following I get

 

"Resource id #44" - And I have no idea where it is getting that from. Here the basic format of my efforts.

 

<?php

require('includes/application_top.php');
include('includes/configure.php');
 if (!tep_session_is_registered('customers_id')) {

// Get the info desired...
$result = tep_db_query("select 'customers_gender' from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "
'");

// Print those results...
echo $result;
}
?>

 

 

I'm fairly confused at this point, I've been googling all day.

 

I got it working at one point - sort off. It would return the value, but only from the first entry in the DB.

My Contributions

 

Henry Smith

Link to comment
Share on other sites

Ok.. I'm playing around with some code trying to fully graps everything. My structure appears correct but my results are not. When I run the following I get

 

"Resource id #44" - And I have no idea where it is getting that from. Here the basic format of my efforts.

 

<?php

require('includes/application_top.php');
include('includes/configure.php');
 if (!tep_session_is_registered('customers_id')) {

// Get the info desired...
$result = tep_db_query("select 'customers_gender' from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "
'");

// Print those results...
echo $result;
}
?>

I'm fairly confused at this point, I've been googling all day.

 

I got it working at one point - sort off. It would return the value, but only from the first entry in the DB.

 

 

$result will be a query resource at that point so you need to use :

 

first put the row in an array:

 

$result_array = tep_db_fetch_array($result);

 

before you can use :

 

echo $result_array['customers_gender'];

Treasurer MFC

Link to comment
Share on other sites

$result will be a query resource at that point so you need to use :

 

first put the row in an array:

 

$result_array = tep_db_fetch_array($result);

 

before you can use :

 

echo $result_array['customers_gender'];

:wub: :wub: :wub: :wub: :wub: :wub: :wub: :wub: :wub:

 

Oh Amanda how I love thee!

 

I have actually tried that ealier but didn't change the echo formatting. So my results were still mangled. It works perfectly now. I've been working on a contrib and this is the only thing I absolutely could not get to work, although my only php trainign has come from looking through OSC and the forum.. my php/mysql books haven't arrived yet, but they should be here any day - I can't wait!

 

 

Since you are obviously quite proficient with PHP, could you recommend any sites that are possible thorough in their explainations, but more advanced then "Hello World!" examples?

My Contributions

 

Henry Smith

Link to comment
Share on other sites

:wub: :wub: :wub: :wub: :wub: :wub: :wub: :wub: :wub:

 

Oh Amanda how I love thee!

 

I have actually tried that ealier but didn't change the echo formatting. So my results were still mangled. It works perfectly now. I've been working on a contrib and this is the only thing I absolutely could not get to work, although my only php trainign has come from looking through OSC and the forum.. my php/mysql books haven't arrived yet, but they should be here any day - I can't wait!

Since you are obviously quite proficient with PHP, could you recommend any sites that are possible thorough in their explainations, but more advanced then "Hello World!" examples?

 

well, I am doing this php now for 2 year but still am a novice, maybe I should get a book as well.

 

what I know is mostly by reading here and by not simply installing a contribution but actually reading it to understand how it works (or was supposed to work in many cases).

 

I normally check functions and constructs here : www.php.net (also has some posts from users who have their own beliefs as to how to use php)

 

and look for novel ideas in here www.phpclasses.org

 

both non-commercial sites so modrs bite your trigger-happy-delete finger.

 

but there are many more php resources out there.

Treasurer MFC

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...