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
https://forums.phpfreaks.com/topic/255193-problem-searching/
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
https://forums.phpfreaks.com/topic/255193-problem-searching/#findComment-1308424
Share on other sites

Archived

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

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