Jump to content

problem searching


abrahamgarcia27

Recommended Posts

I am trying to perform a search but it doesn't see to pass through i thing its because of this \ does any one know how i can pass this trought to search in mysql table

 

 

12\019PB (i cant search this item)

 

$searchlading = mysql_real_escape_string($_GET['searchlading']) ; // get the query for the search engine (if applicable)
$trimmed = trim($searchlading); //trim whitespace from the stored variable
//query for pedimento
$sql_ped = "SELECT order_id, bill_of_lading, pedimento_num FROM `".TABLE_ORDERS."` WHERE bill_of_lading LIKE '%$trimmed%'";

Link to comment
Share on other sites

is probably because i have a mess in my code. :( Well maybe you can spot something or maybe i am doing it wrong

i have two tables one order and order_details

so i need to get a record from the order table and then bring that record  back to order_details

so this is how it works

Search Bill Of Lading -> (go to order table) Get Order ID -> (go to order details table) -> Get all records for that order

so i did this

 

$searchlading = mysql_real_escape_string($_GET['searchlading']) ; // get the query for the search engine (if applicable)
$trimmed = trim($searchlading); //trim whitespace from the stored variable
//query for pedimento
$sql_ped = "SELECT order_id, bill_of_lading, pedimento_num FROM `".TABLE_ORDERS."` WHERE bill_of_lading LIKE '%$trimmed%'";
$record_ped = $db->query_first($sql_ped);

//query for item details
$sql_order = "SELECT order_details_id, order_id, product_id, po_num, warehouse_num, vendor_id FROM `".TABLE_ORDERDETAILS."` WHERE order_id = $record_ped[order_id] ORDER BY order_details_id DESC LIMIT 150";
$rows_order = $db->fetch_all_array($sql_order);
?>


 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.