patheticsam Posted March 27, 2010 Share Posted March 27, 2010 Hi! I'm a little bit new to php and I'm having a little issue here. Here' a little bit of my code so that I can explain : <?php require_once('auth.php'); ?> <?php session_start(); ?> <?php $member = $_SESSION['SESS_MEMBER_ID']; mysql_connect("localhost", "login", "pass") or die(mysql_error()); mysql_select_db("DB") or die(mysql_error()); $data = mysql_query("SELECT * FROM `order` WHERE member_id='$member'") or die(mysql_error()); while($info = mysql_fetch_array( $data )) { $data2 = mysql_query("SELECT * FROM `inventory` WHERE item_id='$info['item_id']'") or die(mysql_error()); while($specs = mysql_fetch_array( $data2 )) { echo " order : ".$info['order_id']."<br /> item : ".$info['item_id']."<br /> status : ".$info['status']."<br /> payment : ".$info['payment']."<br /> "; } } mysql_close(); ?> As you can see I have the first select script wich will SELECT some data in "table1(order)" WHERE the member_id = $_SESSION['SESS_MEMBER_ID'] and after that I have to SELECT some other data into "table2(inventory)" but the thing is that it has to be WHERE = item_id='$info['item_id']'" (So it depends on the data that has been select in the first select command.....) Unfortunatly it's not working and can't seem to get it done. Here's the error I'm getting : Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/content/m/a/z/mazemontana/html/login/members/shopping_cart.php on line 30 Please Help! Thanks!! Link to comment https://forums.phpfreaks.com/topic/196701-problem-with-select-on-multiple-tables-variables-help/ Share on other sites More sharing options...
patheticsam Posted March 27, 2010 Author Share Posted March 27, 2010 Nevermind just got it to work! Still, Thanx! Link to comment https://forums.phpfreaks.com/topic/196701-problem-with-select-on-multiple-tables-variables-help/#findComment-1032706 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.