Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

I want to add a search box in admin to Wishlist report


mariemeh

Recommended Posts

Posted

I've been searching this forum both through the search engine of the forum and both through Google but can't find what I'm doing wrong...

 

I've replaced this code found around line 45:

 

<td height="50" class="pageHeading"><?php echo HEADING_TITLE; ?></td>

 

with this code:

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr><?php echo tep_draw_form('search', FILENAME_STATS_WISHLIST, '', 'get'); ?>

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>

<td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search'); ?></td>

</form></tr>

</table></td>

 

 

and i've replaced this code:

 

<?php

# Get specific list data

if (isset($HTTP_GET_VARS['search'])) {

$search = tep_db_prepare_input($HTTP_GET_VARS['search']);

$customers_query_raw = tep_db_query("select customers_id, customers_firstname, customers_lastname from " .

TABLE_CUSTOMERS . " where customers_id = '".$HTTP_GET_VARS['cid']."'" . tep_db_input($search) . "'order by c.customers_firstname, c.customers_lastname");

$customers = tep_db_fetch_array($customers_query_raw);

?>

 

with this code:

 

<?php

# Get specific list data

if (isset($HTTP_GET_VARS['search'])) {

$search = tep_db_prepare_input($HTTP_GET_VARS['search']);

$customers_query_raw = tep_db_query("select customers_id, customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '".$HTTP_GET_VARS['cid']."'" . tep_db_input($search) . "'order by c.customers_firstname, c.customers_lastname");

}

$customers = tep_db_fetch_array($customers_query_raw);

?>

 

 

and I am getting this error:

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'alice'order by c.customers_firstname, c.customers_lastname' at line 1

 

select customers_id, customers_firstname, customers_lastname from customers where customers_id = ''alice'order by c.customers_firstname, c.customers_lastname

 

[TEP STOP]

 

I've tried many things but I just seem to be making it worst.

 

Can anyone help?

 

oh and thought I should add that there is another customer_query_raw down the page that looks like this:

 

<?php

# Get specific list data

if (isset($HTTP_GET_VARS['search'])) {

$search = tep_db_prepare_input($HTTP_GET_VARS['search']);

$customers_query_raw = tep_db_query("select customers_id, customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '".$HTTP_GET_VARS['cid']."'" . tep_db_input($search) . "'order by c.customers_firstname, c.customers_lastname");

}

$customers = tep_db_fetch_array($customers_query_raw);

?>

 

should I have modified this one instead and if such, what's wrong in my syntax still as I get the error when I put the code there as well.

 

TIA

Archived

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

×
×
  • Create New...