vozzek Posted September 25, 2007 Share Posted September 25, 2007 Hi again all, Quick Dreamweaver problem: I've got an add_inventory.php page that populates my database keyed off of 'id'. When I built the record insertion form it asked for a destination, which I put in as show_inventory.php. I built this page later on, to show certain fields the user just entered. Added a recordset to the add page (rs_add_inventory), only choosing the 'id' field. I need to pass that parameter to the show page, so it can display all the fields. So going into the code, I saw Dreamweaver had written the following lines of code: $insertGoTo = "show_inventory.php" if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; I modified the top line of code to read as follows, thinking it would pass the parameter: $insertGoTo = "show_inventory.php?recordID=<?php echo $row_rs_add_inventory['id']; ?>"; Can anyone see what I did wrong? I'm getting a Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING I'm kinda new at this, so any help would be appreciated. Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/70648-passing-record-id-problem-wdreamweaver/ Share on other sites More sharing options...
sasa Posted September 25, 2007 Share Posted September 25, 2007 try $insertGoTo = "show_inventory.php?recordID=" . $row_rs_add_inventory['id']; Quote Link to comment https://forums.phpfreaks.com/topic/70648-passing-record-id-problem-wdreamweaver/#findComment-355106 Share on other sites More sharing options...
vozzek Posted September 25, 2007 Author Share Posted September 25, 2007 Ah, I should probably smack myself in the forehead for not trying concatenation. Thanks! Someone else just pointed this out to me also. However, it still doesn't pass the 'id' value. I think your syntax is 100% correct but unfortunately since this is the posting form, the 'id' value hasn't actually been defined yet (at the time) if that makes any sense. It's a self-incrementing element of the database, so I guess maybe it happens after the posting? I think I'm trying to do the database call before the element is populated... dunno. Still confused. Quote Link to comment https://forums.phpfreaks.com/topic/70648-passing-record-id-problem-wdreamweaver/#findComment-355120 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.