Hi guys,
Im a little stuck here and was hoping for some help if possible??
I am trying to extract a product code from a sessions file for use in a MYSQL database query.
This is sample line (entry) from the sessions file:
How can i just extract the item number 'ABC123' so I can use it in the query ($inv_query) below?Code:ABC123 item name 129.95 1 N;
Any help would be greatly appreciated.PHP Code:$session_id = $_SESSION["sessionid"];
$fp = fopen ("./sessions/".$session_id.".dat", "r");
while ($data = fgetcsv ($fp, 500)) {
//setup values from array
$item_id = $data[0]; //we'll test for this one below to ensure we don't bring in blank rows
$item_qty = $data[3];
$inv_query = "SELECT * FROM Products_Test WHERE product_id='$item_id'";







Bookmarks