cypr Posted August 17, 2007 Share Posted August 17, 2007 I get this error: Cannot use a scalar value as an array What can I do??? what's this? Quote Link to comment https://forums.phpfreaks.com/topic/65514-solved-cannot-use-a-scalar-value-as-an-array/ Share on other sites More sharing options...
Orio Posted August 17, 2007 Share Posted August 17, 2007 Show the code please, and if the error mentioned a line that'd be helpful too. Orio. Quote Link to comment https://forums.phpfreaks.com/topic/65514-solved-cannot-use-a-scalar-value-as-an-array/#findComment-327134 Share on other sites More sharing options...
cypr Posted August 17, 2007 Author Share Posted August 17, 2007 <?php session_start(); include ("../../../../db.php"); $val = $_POST['value']; //$x = explode(":-:",$val); $user = mysql_query("SELECT * FROM user WHERE ID = ".$val." "); while($row = mysql_fetch_array($user)) { $_SESSION['users']['user2']['user_name'] = $row['User_Name']; $_SESSION['users']['user2']['ID'] = $row['ID']; } $user = mysql_query("SELECT * FROM user WHERE User_Name = '".$_SESSION['MM_Username832']."'"); while($row = mysql_fetch_array($user)) { $_SESSION['users']['you']['user_name'] = $row['User_Name']; $_SESSION['users']['you']['ID'] = $row['ID']; } echo $val."-".$_SESSION['users']['user2']['user_name']."-".$_SESSION['users']['you']['user_name']; ?> and here are the errors: Warning: Cannot use a scalar value as an array in /opt/lampp/htdocs/sites/cardmarkit/pages/unique_tracker/trading2_files/sessions/sports.php on line 9 Warning: Cannot use a scalar value as an array in /opt/lampp/htdocs/sites/cardmarkit/pages/unique_tracker/trading2_files/sessions/sports.php on line 10 Warning: Cannot use a scalar value as an array in /opt/lampp/htdocs/sites/cardmarkit/pages/unique_tracker/trading2_files/sessions/sports.php on line 15 Warning: Cannot use a scalar value as an array in /opt/lampp/htdocs/sites/cardmarkit/pages/unique_tracker/trading2_files/sessions/sports.php on line 16 this works perfectly in windows...... Quote Link to comment https://forums.phpfreaks.com/topic/65514-solved-cannot-use-a-scalar-value-as-an-array/#findComment-327136 Share on other sites More sharing options...
cypr Posted August 17, 2007 Author Share Posted August 17, 2007 anyone? Quote Link to comment https://forums.phpfreaks.com/topic/65514-solved-cannot-use-a-scalar-value-as-an-array/#findComment-327196 Share on other sites More sharing options...
cypr Posted August 17, 2007 Author Share Posted August 17, 2007 ok.....it seems that it's not working for 3d session arrays..... it works with 2d session arrays and 1d ......) .......so....I say again.... Anyone Got any Ideas? can I change this stuff from settings???? Quote Link to comment https://forums.phpfreaks.com/topic/65514-solved-cannot-use-a-scalar-value-as-an-array/#findComment-327210 Share on other sites More sharing options...
cypr Posted August 18, 2007 Author Share Posted August 18, 2007 ok...just so everyone knows.... 1. I was right....it was a configuration problem 2. I did not fix it 3. I'm on windows now and it works perfectly thank's for reading... see u later Quote Link to comment https://forums.phpfreaks.com/topic/65514-solved-cannot-use-a-scalar-value-as-an-array/#findComment-327636 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.