Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

what are the differences between these lines?


xvoyance

Recommended Posts

The following three lines came from OSC categories.php

==============================================

$sql_data_array = array('products_name' => tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id]),

'products_description' => tep_db_prepare_input($HTTP_POST_VARS['products_description'][$language_id]),

'products_url' => tep_db_prepare_input($HTTP_POST_VARS['products_url'][$language_id]));

===============================================

Presumably they read data from the submitted form. I want to put the data by hand.

Therefore, I change them into

===============================================

$sql_data_array ['products_name'][$language_id] = "my name";

$sql_data_array ['products_description'][$language_id] = "my information";

$sql_data_array ['products_url'][$language_id] = "my url";

================================================

 

Some information is missing in the modified version.

Anyone knows how to change them?

Link to comment
Share on other sites

I would suggest that you get a book on teaching yourself PHP and learn the language. It's obvious that you don't know what's going on here. If you want to set $sql_data_array to three fixed strings, do this:

$sql_data_array = array('products_name' => "my name",
			'products_description' => "my information",
			'products_url' => "my url");

 

There is no language information in $sql_data_array.

Link to comment
Share on other sites

I would suggest that you get a book on teaching yourself PHP and learn the language. It's obvious that you don't know what's going on here. If you want to set $sql_data_array to three fixed strings, do this:

$sql_data_array = array('products_name' => "my name",
			'products_description' => "my information",
			'products_url' => "my url");

 

There is no language information in $sql_data_array.

 

I have many books. But what is wrong with my expression? Isn't those two methods for entering array contents equivalent? Furthermore, what you wrote is one-dimensional array. My array is 2-d, with $language_id

Link to comment
Share on other sites

Mr Phil has already told you.

 

$sql_data_array must be an array of key => value pairs with the values as strings.

 

Your version is incorrect as the values are arrays. ( the language_id you introduced ).

Link to comment
Share on other sites

Mr Phil has already told you.

 

$sql_data_array must be an array of key => value pairs with the values as strings.

 

Your version is incorrect as the values are arrays. ( the language_id you introduced ).

 

oh....thanks....I mixed up....

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...