auzz Posted April 22, 2011 Share Posted April 22, 2011 This is the error.. Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$' in /htdocs/testing//suggest.php on line 35 ..and this is line 35 in suggest.php... mysql['username'],$mysql['password']); could you point me in the right direction?. Thanks. edit - oh, and the context of the code is... mysql_connect($mysql['host'],$ mysql['username'],$mysql['password']); mysql_select_db($mysql['db']); Link to comment https://forums.phpfreaks.com/topic/234457-error-in-my-php-unexpected-t_string-expecting-t_variable-or/ Share on other sites More sharing options...
Pikachu2000 Posted April 22, 2011 Share Posted April 22, 2011 The parentheses almost certainly don't belong after the semicolon. Post a few lines before and a few lines after line 35 also. Link to comment https://forums.phpfreaks.com/topic/234457-error-in-my-php-unexpected-t_string-expecting-t_variable-or/#findComment-1204945 Share on other sites More sharing options...
kenrbnsn Posted April 22, 2011 Share Posted April 22, 2011 We need to see more of your code. Ken Link to comment https://forums.phpfreaks.com/topic/234457-error-in-my-php-unexpected-t_string-expecting-t_variable-or/#findComment-1204946 Share on other sites More sharing options...
fugix Posted April 22, 2011 Share Posted April 22, 2011 There should be no $ in that line of code Link to comment https://forums.phpfreaks.com/topic/234457-error-in-my-php-unexpected-t_string-expecting-t_variable-or/#findComment-1204947 Share on other sites More sharing options...
auzz Posted April 22, 2011 Author Share Posted April 22, 2011 This is the error.. Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$' in /htdocs/testing//suggest.php on line 35 ..and this is line 35 in suggest.php... mysql['username'],$mysql['password']); could you point me in the right direction?. Thanks. edit - oh, and the context of the code is... mysql_connect($mysql['host'],$ mysql['username'],$mysql['password']); mysql_select_db($mysql['db']); Just updated my original post. Added the surrounding code. If you need more, then i'll post the intire lot? Link to comment https://forums.phpfreaks.com/topic/234457-error-in-my-php-unexpected-t_string-expecting-t_variable-or/#findComment-1204948 Share on other sites More sharing options...
kenrbnsn Posted April 22, 2011 Share Posted April 22, 2011 These two lines <?php mysql_connect($mysql['host'],$ mysql['username'],$mysql['password']); ?> should be written as one line <?php mysql_connect($mysql['host'],$mysql['username'],$mysql['password']); ?> Ken Link to comment https://forums.phpfreaks.com/topic/234457-error-in-my-php-unexpected-t_string-expecting-t_variable-or/#findComment-1204950 Share on other sites More sharing options...
fugix Posted April 22, 2011 Share Posted April 22, 2011 Yeah. Shoul be all one line without line breaks Link to comment https://forums.phpfreaks.com/topic/234457-error-in-my-php-unexpected-t_string-expecting-t_variable-or/#findComment-1204952 Share on other sites More sharing options...
auzz Posted April 22, 2011 Author Share Posted April 22, 2011 Thanks very much.. My problem is solved now. Link to comment https://forums.phpfreaks.com/topic/234457-error-in-my-php-unexpected-t_string-expecting-t_variable-or/#findComment-1204972 Share on other sites More sharing options...
fugix Posted April 22, 2011 Share Posted April 22, 2011 glad we could help Link to comment https://forums.phpfreaks.com/topic/234457-error-in-my-php-unexpected-t_string-expecting-t_variable-or/#findComment-1204982 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.