snowdog Posted February 13, 2013 Share Posted February 13, 2013 I have to display 4 images in a table. The images are held in a directory structure that goes like this: franchises\franchise_id_1\lotImages\dealer_id_1\lot_id_1\wheelFL.jpeg Each 1 is actually a variable that comes from the database and depends on what dealer and franchise is logged in. Here is how I would write it: I can only assume it is not the proper way to do it. Any suggestions on the proper way to write something like this? <?php echo("<tr><td> $run['vinNumber'] </td><td> $run['carYear'] $nbsp; $run['carModel'] </td><td><img src='franchises/franchise_id_."$franchise_id"./lotImages/dealer_id_."$dealer_id"./lot_id."$run['id']".wheelFL.jpeg'></td></tr>"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/274427-help-with-concatination-and-proper-code-layout/ Share on other sites More sharing options...
scootstah Posted February 13, 2013 Share Posted February 13, 2013 Have you tried the manual? Quote Link to comment https://forums.phpfreaks.com/topic/274427-help-with-concatination-and-proper-code-layout/#findComment-1412145 Share on other sites More sharing options...
snowdog Posted February 13, 2013 Author Share Posted February 13, 2013 yes and not understanding it Quote Link to comment https://forums.phpfreaks.com/topic/274427-help-with-concatination-and-proper-code-layout/#findComment-1412147 Share on other sites More sharing options...
scootstah Posted February 13, 2013 Share Posted February 13, 2013 You have the concatenation backwards. It should be " . $var . " (not . "$var" . ). Quote Link to comment https://forums.phpfreaks.com/topic/274427-help-with-concatination-and-proper-code-layout/#findComment-1412150 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.